X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..e0a09ce41962009495be1f25c6c9f5e5ec11be18:/include/wx/memory.h diff --git a/include/wx/memory.h b/include/wx/memory.h index 840d5085ca..8f5c81ae95 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -9,8 +9,8 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifndef __MEMORYH__ -#define __MEMORYH__ +#ifndef _WX_MEMORYH__ +#define _WX_MEMORYH__ #ifdef __GNUG__ #pragma interface "memory.h" @@ -23,23 +23,27 @@ info, or to be a straight call to the new operator. */ -#if (DEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT +#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #include -#if USE_IOSTREAMH -#include +#if wxUSE_IOSTREAMH +# include #else -#include +# include +# ifdef _MSC_VER + using namespace std; +# endif #endif #include "wx/string.h" -#ifndef WXDEBUG_NEW -#define WXDEBUG_NEW new(__FILE__,__LINE__) -#endif +#if WXDEBUG + +// #ifndef WXDEBUG_NEW +// #define WXDEBUG_NEW new(__FILE__,__LINE__) +// #endif -#if DEBUG void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bool isVect = FALSE); void wxDebugFree(void * buf, bool isVect = FALSE); @@ -47,7 +51,7 @@ void wxDebugFree(void * buf, bool isVect = FALSE); // Currently, these merely call malloc and free; only the wxObject // operators do something interesting. But this allows WXDEBUG_NEW to // work for all 'new's in a file. -#if USE_GLOBAL_MEMORY_OPERATORS +#if wxUSE_GLOBAL_MEMORY_OPERATORS #ifdef new #undef new @@ -56,10 +60,15 @@ void wxDebugFree(void * buf, bool isVect = FALSE); void * operator new (size_t size, char * fileName, int lineNum); void operator delete (void * buf); +// VC++ 6.0 +#if _MSC_VER >= 1200 +void operator delete(void *buf, char*, int); +#endif + +#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) void * operator new[] (size_t size, char * fileName, int lineNum); void operator delete[] (void * buf); - -#define new WXDEBUG_NEW +#endif #endif #endif @@ -261,17 +270,17 @@ void WXDLLEXPORT wxTraceLevel(int level, const char *fmt ...); #define WXTRACE wxTrace #define WXTRACELEVEL wxTraceLevel -#else // else part for the #if DEBUG +#else // else part for the #if WXDEBUG inline void wxTrace(const char *WXUNUSED(fmt)) {} inline void wxTraceLevel(int WXUNUSED(level), const char *WXUNUSED(fmt)) {} #define WXTRACE TRUE ? (void)0 : wxTrace #define WXTRACELEVEL TRUE ? (void)0 : wxTraceLevel -#define WXDEBUG_NEW new +// #define WXDEBUG_NEW new -#endif // DEBUG +#endif // WXDEBUG #endif - // __MEMORYH__ + // _WX_MEMORYH__