]> git.saurik.com Git - wxWidgets.git/commitdiff
added dynamic shared library (dylib) initialization routine for Darwin
authorGilles Depeyrot <gilles_depeyrot@mac.com>
Sun, 25 Nov 2001 21:52:58 +0000 (21:52 +0000)
committerGilles Depeyrot <gilles_depeyrot@mac.com>
Sun, 25 Nov 2001 21:52:58 +0000 (21:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/object.cpp

index a444c031ee5ff362936e23d7589ee483e3ff51fa..66d78f24b526c700f229b2a6d051df6defd0acaf 100644 (file)
@@ -407,3 +407,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