X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/acd15a3fa015caf2d1e3213a7694b05c92d5b49c..33754c4d83c59b7523a6da0c4fb21079cb60301c:/src/common/object.cpp diff --git a/src/common/object.cpp b/src/common/object.cpp index a444c031ee..20e531a1f2 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -32,6 +32,11 @@ #endif // wxUSE_SERIAL #endif // WX_PRECOMP +#ifdef __VISAGECPP__ + #include "wx/objstrm.h" + #include "wx/serbase.h" +#endif + #include #include @@ -407,3 +412,26 @@ wxObjectRefData::wxObjectRefData(void) : m_count(1) wxObjectRefData::~wxObjectRefData() { } + +#if defined(__DARWIN__) && defined(DYLIB_INIT) + +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 +// +void wxWindowsDylibInit() +{ + // The function __initialize_Cplusplus() must be called from the shared + // library initialization routine to cause the static C++ objects in + // the library to be initialized (reference number 2441683). + + __initialize_Cplusplus(); +} + +#endif