]> www.ginac.de Git - cln.git/blob - src/float/lfloat/elem/cl_LF_globals.cc
Replace CL_REQUIRE/CL_PROVIDE(cl_LF_globals) with portable code.
[cln.git] / src / float / lfloat / elem / cl_LF_globals.cc
1 // Global variables for cl_LF.
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/number.h"
8
9
10 // Implementation.
11
12 #include "cl_LF.h"
13 #include "cl_LF_impl.h"
14
15 namespace cln {
16
17 // Only needed for the default constructor of cl_LF.
18 const cl_LF cl_LF_0 = cl_LF_0; // 0.0L0
19
20 int cl_LF_globals_init_helper::count = 0;
21 cl_LF_globals_init_helper::cl_LF_globals_init_helper()
22 {
23         if (count++ == 0)
24                 new ((void *)&cl_LF_0) cl_LF(encode_LF0(LF_minlen)); // 0.0L0
25 }
26
27 cl_LF_globals_init_helper::~cl_LF_globals_init_helper()
28 {
29         if (--count == 0) {
30                 // Nothing to clean up
31         }
32 }
33
34 }  // namespace cln
35