fixes for operator new declaration/definition (patch 549349)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-04-27 10:35:04 +00:00
parent b2edef6f2f
commit cf760e4c30
2 changed files with 15 additions and 10 deletions

View File

@ -411,7 +411,7 @@ public:
// 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
@ -423,11 +423,11 @@ public:
#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
@ -435,7 +435,7 @@ public:
#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

View File

@ -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);
}