From: Gilles Depeyrot Date: Fri, 3 May 2002 17:46:01 +0000 (+0000) Subject: static C++ object initialization only seems to be necessary when the library X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/edf0993cae024ed0e298608184d8dbc0063620af static C++ object initialization only seems to be necessary when the library initialization routine needs to use static C++ objects git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/object.cpp b/src/common/object.cpp index c091b0c681..b3b09abf92 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -189,7 +189,7 @@ void wxClassInfo::InitializeClasses() size_t nClass = 0; #endif - wxClassInfo::sm_classTable = new wxHashTable(wxKEY_STRING); + sm_classTable = new wxHashTable(wxKEY_STRING); // Index all class infos by their class name @@ -325,17 +325,17 @@ wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const // misc // ---------------------------------------------------------------------------- -#if defined(__DARWIN__) && defined(DYLIB_INIT) +#if defined(__DARWIN__) && defined(WXMAKINGDLL) extern "C" { void __initialize_Cplusplus(void); void wxWindowsDylibInit(void); }; - // Dynamic shared library (dylib) initialization routine - // required to initialize static C++ objects bacause of lazy dynamic linking - // http://developer.apple.com/techpubs/macosx/Essentials/ - // SystemOverview/Frameworks/Dynamic_Shared_Libraries.html +// Dynamic shared library (dylib) initialization routine +// required to initialize static C++ objects bacause of lazy dynamic linking +// http://developer.apple.com/techpubs/macosx/Essentials/ +// SystemOverview/Frameworks/Dynamic_Shared_Libraries.html void wxWindowsDylibInit() { @@ -343,6 +343,8 @@ void wxWindowsDylibInit() // library initialization routine to cause the static C++ objects in // the library to be initialized (reference number 2441683). + // This only seems to be necessary if the library initialization routine + // needs to use the static C++ objects __initialize_Cplusplus(); }