Strings - Library initalisation

The string library makes use of a Schwarz counter to ensure it is
correctly initialized.
This commit is contained in:
Emmanuel BENOîT 2020-09-27 13:49:00 +02:00
parent a22cca26e2
commit 9a3d4ad4a7
2 changed files with 77 additions and 43 deletions
include/ebcl

View file

@ -459,6 +459,19 @@ M_LSHIFT_OP( T_StringBuilder , float );
M_LSHIFT_OP( T_StringBuilder , double );
/*= STRING LIBRARY INITIALIZER ===============================================*/
/* A few things in the string library need to be initialised as soon as
* anything that may use it is loaded. This includes the string pool and the
* "empty string" constant.
*/
static struct T_StringLibInitializer
{
T_StringLibInitializer( );
~T_StringLibInitializer( );
} StringLibInitializer;
} // namespace
#endif // _H_EBCL_STRINGS
#include <ebcl/inline/Strings.hh>