]> www.ginac.de Git - cln.git/blob - src/base/output/cl_prin_globals.cc
Replace CL_REQUIRE/CL_PROVIDE(cl_prin_globals) with portable code.
[cln.git] / src / base / output / cl_prin_globals.cc
1 // Global variables in CLN
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/output.h"
8
9
10 // Implementation.
11
12 namespace cln {
13
14 cl_print_flags default_print_flags;
15
16 int cl_prin_globals_init_helper::count = 0;
17
18 cl_prin_globals_init_helper::cl_prin_globals_init_helper()
19 {
20         if (count++ == 0)
21                 new ((void *)&default_print_flags) cl_print_flags();
22 }
23
24 cl_prin_globals_init_helper::~cl_prin_globals_init_helper()
25 {
26         if (--count == 0) {
27                 // Nothing to clean up.
28         }
29 }
30
31
32 #if 0 // The default constructors already do this.
33 AT_INITIALIZATION(default_print_flags)
34 {
35         default_print_flags.rational_base = 10;
36         default_print_flags.rational_readably = false;
37         default_print_flags.float_readably = false;
38         default_print_flags.default_float_format = float_format_ffloat;
39         default_print_flags.complex_readably = false;
40         default_print_flags.vector_syntax = vsyntax_pretty;
41         default_print_flags.univpoly_varname = "x";
42 }
43 #endif
44
45 }  // namespace cln
46