]> www.ginac.de Git - cln.git/blobdiff - src/base/output/cl_prin_globals.cc
bump library version, since CLN doesn't export global object ctors any more.
[cln.git] / src / base / output / cl_prin_globals.cc
index 543c865d93ea8ba9a7fac71da54f71707743b0ef..fd61467303570f0884e56af3bd298ab3335cd2fc 100644 (file)
@@ -3,8 +3,6 @@
 // General includes.
 #include "cl_sysdep.h"
 
-CL_PROVIDE(cl_prin_globals)
-
 // Specification.
 #include "cln/output.h"
 
@@ -14,6 +12,23 @@ CL_PROVIDE(cl_prin_globals)
 namespace cln {
 
 cl_print_flags default_print_flags;
+
+int cl_prin_globals_init_helper::count = 0;
+
+cl_prin_globals_init_helper::cl_prin_globals_init_helper()
+{
+       if (count++ == 0)
+               new ((void *)&default_print_flags) cl_print_flags();
+}
+
+cl_prin_globals_init_helper::~cl_prin_globals_init_helper()
+{
+       if (--count == 0) {
+               // Nothing to clean up.
+       }
+}
+
+
 #if 0 // The default constructors already do this.
 AT_INITIALIZATION(default_print_flags)
 {
@@ -29,4 +44,3 @@ AT_INITIALIZATION(default_print_flags)
 
 }  // namespace cln
 
-CL_PROVIDE_END(cl_prin_globals)