X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3b9f782ef3949f583e8ac53795d36787f044fc3..1aecefa501029a2b25e719f42ecd8dd1ef07aaf4:/src/common/memory.cpp?ds=sidebyside diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 993b39a7a9..8855c9d3de 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -16,7 +16,7 @@ #pragma hdrstop #endif -#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT +#if wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT #include "wx/memory.h" @@ -46,7 +46,7 @@ #include #include -#if wxUSE_THREADS && defined(__WXDEBUG__) +#if wxUSE_THREADS #define USE_THREADSAFE_MEMORY_ALLOCATION 1 #else #define USE_THREADSAFE_MEMORY_ALLOCATION 0 @@ -575,18 +575,13 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from) */ bool wxDebugContext::PrintList (void) { -#ifdef __WXDEBUG__ TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : NULL)); return true; -#else - return false; -#endif } bool wxDebugContext::Dump(void) { -#ifdef __WXDEBUG__ { const wxChar* appName = wxT("application"); wxString appNameStr; @@ -608,12 +603,8 @@ bool wxDebugContext::Dump(void) OutputDumpLine(wxEmptyString); return true; -#else - return false; -#endif } -#ifdef __WXDEBUG__ struct wxDebugStatsStruct { long instanceCount; @@ -638,11 +629,9 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt st->next = head; return st; } -#endif bool wxDebugContext::PrintStatistics(bool detailed) { -#ifdef __WXDEBUG__ { const wxChar* appName = wxT("application"); wxString appNameStr; @@ -729,10 +718,6 @@ bool wxDebugContext::PrintStatistics(bool detailed) OutputDumpLine(wxEmptyString); return true; -#else - (void)detailed; - return false; -#endif } bool wxDebugContext::PrintClasses(void) @@ -846,16 +831,16 @@ void wxDebugContext::OutputDumpLine(const wxChar *szFormat, ...) int count; va_list argptr; va_start(argptr, szFormat); - buf[sizeof(buf)/sizeof(wxChar)-1] = _T('\0'); + buf[WXSIZEOF(buf)-1] = wxT('\0'); // keep 3 bytes for a \r\n\0 - count = wxVsnprintf(buf, sizeof(buf)/sizeof(wxChar)-3, szFormat, argptr); + count = wxVsnprintf(buf, WXSIZEOF(buf)-3, szFormat, argptr); if ( count < 0 ) - count = sizeof(buf)/sizeof(wxChar)-3; - buf[count]=_T('\r'); - buf[count+1]=_T('\n'); - buf[count+2]=_T('\0'); + count = WXSIZEOF(buf)-3; + buf[count]=wxT('\r'); + buf[count+1]=wxT('\n'); + buf[count+2]=wxT('\0'); wxMessageOutputDebug dbgout; dbgout.Printf(buf); @@ -902,7 +887,6 @@ static MemoryCriticalSection memLocker; #endif // USE_THREADSAFE_MEMORY_ALLOCATION -#ifdef __WXDEBUG__ #if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) #if wxUSE_GLOBAL_MEMORY_OPERATORS void * operator new (size_t size, wxChar * fileName, int lineNum) @@ -1049,8 +1033,6 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) ) free((char *)st); } -#endif // __WXDEBUG__ - // Trace: send output to the current debugging stream void wxTrace(const wxChar * ...) { @@ -1167,4 +1149,4 @@ void wxDebugContextDumpDelayCounter::DoDump() // least one cleanup counter object static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One; -#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT +#endif // wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT