X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2edef6f2f587d957eabbc17364382293707340f..94e36a5196e52314b56c1b4d29bae0d02519af55:/src/common/object.cpp?ds=inline diff --git a/src/common/object.cpp b/src/common/object.cpp index a9b7d22d61..b3b09abf92 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -77,11 +77,16 @@ void wxObject::Dump(wxSTD ostream& str) #endif +#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING && defined( new ) + #undef new +#endif + + #ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT -void *wxObject::operator new ( size_t size, wxChar *fileName, int lineNum ) +void *wxObject::operator new ( size_t size, const wxChar *fileName, int lineNum ) { - return wxDebugAlloc(size, fileName, lineNum, TRUE); + return wxDebugAlloc(size, (wxChar*) fileName, lineNum, TRUE); } #endif @@ -100,16 +105,16 @@ void wxObject::operator delete ( void *buf, const char *_fname, size_t _line ) #endif #ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT -void wxObject::operator delete ( void *buf, wxChar *WXUNUSED(fileName), int WXUNUSED(lineNum) ) +void wxObject::operator delete ( void *buf, const wxChar *WXUNUSED(fileName), int WXUNUSED(lineNum) ) { wxDebugFree(buf); } #endif #ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT -void *wxObject::operator new[] ( size_t size, wxChar* WXUNUSED(fileName), int WXUNUSED(lineNum) ) +void *wxObject::operator new[] ( size_t size, const wxChar* fileName, int lineNum ) { - return wxDebugAlloc(size, fileName, lineNum, TRUE, TRUE); + return wxDebugAlloc(size, (wxChar*) fileName, lineNum, TRUE, TRUE); } #endif @@ -121,7 +126,7 @@ void wxObject::operator delete[] ( void *buf ) #endif #ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT -void wxObject::operator delete[] (void * buf, wxChar* WXUNUSED(fileName), int WXUNUSED(lineNum) ) +void wxObject::operator delete[] (void * buf, const wxChar* WXUNUSED(fileName), int WXUNUSED(lineNum) ) { wxDebugFree(buf, TRUE); } @@ -184,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 @@ -320,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() { @@ -338,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(); }