The order of initialization of non-local objects in different compilation units
is not specified in C++. Hence special care should be taken to avoid static
initialization order fiasco. CLN solved the problem with some evil (GCC
specific, and even GCC-version-specific) hack. Replace it with a technique
similar to one used in STL to initialize std::cout and friends.
}
inline cl_string::cl_string ()
{
- extern const cl_string cl_null_string;
- pointer = (cl_heap_string*) cl_null_string;
+ static const cl_string cl_null_st(NULL, 0);
+ pointer = (cl_heap_string*) cl_null_st;
}
-CL_REQUIRE(cl_st_null)
// Hash code.
extern unsigned long hashcode (const cl_string& str);
// General includes.
#include "cl_sysdep.h"
-CL_PROVIDE(cl_st_null)
-
// Specification.
#include "cln/string.h"
namespace cln {
+#warning "Please remove me"
extern const cl_string cl_null_string;
} // namespace cln
} // namespace cln
-CL_PROVIDE_END(cl_st_null)