// Turn on the correct set of new and delete operators
#ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT
- void *operator new ( size_t size, wxChar *fileName = NULL, int lineNum = 0 );
+ void *operator new ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 );
#endif
#ifdef _WX_WANT_DELETE_VOID
#endif
#ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT
- void operator delete ( void *buf, wxChar*, int );
+ void operator delete ( void *buf, const wxChar*, int );
#endif
#ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
- void *operator new[] ( size_t size, wxChar *fileName = NULL, int lineNum = 0 );
+ void *operator new[] ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 );
#endif
#ifdef _WX_WANT_ARRAY_DELETE_VOID
#endif
#ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
- void operator delete[] (void* buf, wxChar*, int );
+ void operator delete[] (void* buf, const wxChar*, int );
#endif
#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
#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
#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);
}