X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30c710fd9dc015ba7d4f24c14e18a37a67733070..e29b83a455bead3dae44300f631d07aa9635d3e9:/src/common/memory.cpp diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 3f8ea5028d..e89bd8835c 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -49,7 +49,7 @@ # endif #endif -#if !defined(__WATCOMC__) && !defined(__VMS__) +#if !defined(__WATCOMC__) && !defined(__VMS__) && !defined( __MWERKS__ ) #include #endif @@ -532,6 +532,8 @@ bool wxDebugContext::SetFile(const wxString& file) bool wxDebugContext::SetStandardError(void) { + // Obsolete +#if 0 #if !defined(_WINDLL) wxDebugStreamBuf *buf = new wxDebugStreamBuf; ostream *stream = new ostream(m_streamBuf); @@ -540,6 +542,8 @@ bool wxDebugContext::SetStandardError(void) #else return FALSE; #endif +#endif + return FALSE; } @@ -909,7 +913,7 @@ int wxDebugContext::CountObjectsLeft(bool sinceCheckpoint) wxMemStruct *from = NULL; if (sinceCheckpoint && checkPoint) from = checkPoint->m_next; - if (from == (wxMemStruct*) NULL) + else from = wxDebugContext::GetHead () ; for (wxMemStruct * st = from; st != 0; st = st->m_next) @@ -965,7 +969,7 @@ void * operator new (size_t size) #endif } -#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) +#if wxUSE_ARRAY_MEMORY_OPERATORS void * operator new[] (size_t size) { #ifdef NO_DEBUG_ALLOCATION @@ -976,7 +980,7 @@ void * operator new[] (size_t size) } #endif -#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) +#if wxUSE_ARRAY_MEMORY_OPERATORS void * operator new[] (size_t size, char * fileName, int lineNum) { #ifdef NO_DEBUG_ALLOCATION @@ -1011,7 +1015,7 @@ void operator delete[](void* pData, char* /* fileName */, int /* lineNum */) } #endif -#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) +#if wxUSE_ARRAY_MEMORY_OPERATORS void operator delete[] (void * buf) { @@ -1036,7 +1040,8 @@ void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bo return (void *)malloc(size); } - char * buf = (char *) malloc(wxDebugContext::TotSize (size)); + int totSize = wxDebugContext::TotSize (size); + char * buf = (char *) malloc(totSize); if (!buf) { wxLogDebug("Call to malloc (%ld) failed.", (long)size); return 0;