X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fabb57533169f2f75367e0d120c762518548890..8ffd43c56b793781fde046aa532340b92a0067eb:/include/wx/memory.h?ds=sidebyside diff --git a/include/wx/memory.h b/include/wx/memory.h index c6ee00a4e0..23f64dca35 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -6,7 +6,7 @@ // Created: 29/01/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MEMORYH__ @@ -17,6 +17,7 @@ #endif #include "wx/defs.h" +#include "wx/string.h" /* The macro which will be expanded to include the file and line number @@ -28,17 +29,15 @@ #include #if wxUSE_IOSTREAMH -// N.B. BC++ doesn't have istream.h, ostream.h -# include + // N.B. BC++ doesn't have istream.h, ostream.h +# include #else -# include -# ifdef _MSC_VER - using namespace std; -# endif +# include +# if defined(__VISUALC__) || defined(__MWERKS__) + using namespace std; +# endif #endif -#include "wx/string.h" - #ifdef __WXDEBUG__ void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bool isVect = FALSE); @@ -50,29 +49,45 @@ void wxDebugFree(void * buf, bool isVect = FALSE); // Undefine temporarily (new is #defined in object.h) because we want to // declare some new operators. #ifdef new -#undef new + #undef new +#endif + +#if defined(__SUNCC__) + #define wxUSE_ARRAY_MEMORY_OPERATORS 0 +#elif !( defined (__VISUALC__) && (__VISUALC__ <= 1020) ) || defined( __MWERKS__) + #define wxUSE_ARRAY_MEMORY_OPERATORS 1 +#elif defined (__SGI_CC_) + // only supported by -n32 compilers + #ifndef __EDG_ABI_COMPATIBILITY_VERSION + #define wxUSE_ARRAY_MEMORY_OPERATORS 0 + #endif +#else + // ::operator new[] is a recent C++ feature, so assume it's not supported + #define wxUSE_ARRAY_MEMORY_OPERATORS 0 #endif // Added JACS 25/11/98: needed for some compilers void * operator new (size_t size); -void * operator new[] (size_t size); void * operator new (size_t size, char * fileName, int lineNum); void operator delete (void * buf); -#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) -void * operator new[] (size_t size, char * fileName, int lineNum); -void operator delete[] (void * buf); +#if wxUSE_ARRAY_MEMORY_OPERATORS + void * operator new[] (size_t size); + void * operator new[] (size_t size, char * fileName, int lineNum); + void operator delete[] (void * buf); #endif // VC++ 6.0 -#if _MSC_VER >= 1200 -void operator delete(void *buf, char*, int); -void operator delete[](void *buf, char*, int); +#if defined(__VISUALC__) && (__VISUALC__ >= 1200) + void operator delete(void *buf, char*, int); + void operator delete[](void *buf, char*, int); #endif #endif + // wxUSE_GLOBAL_MEMORY_OPERATORS #endif + // __WXDEBUG__ typedef unsigned int wxMarkerType;