diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 0b10dbb7f567b433807210e1eed4f5fd2b7da492..97db40aefce204a271137ee8388186e8184ac9dd 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -59,10 +59,10 @@ uint riobp; #ifdef _WIN32 HANDLE exec_mutex; - #ifdef _DEBUG + #if defined(_DEBUG) && defined(_MSC_VER) HANDLE debug_log=INVALID_HANDLE_VALUE; _CrtMemState mem_chkpoint; - #endif // _DEBUG + #endif // _DEBUG && _MSC_VER #endif // _WIN32 @@ -1964,7 +1964,7 @@ sbbs_t::~sbbs_t() FREE_AND_NULL(batdn_cdt); FREE_AND_NULL(batdn_alt); -#if defined(_WIN32) && defined(_DEBUG) +#if defined(_WIN32) && defined(_DEBUG) && defined(_MSC_VER) if(!_CrtCheckMemory()) lprintf("!MEMORY ERRORS REPORTED IN DATA/DEBUG.LOG!"); #endif @@ -2812,14 +2812,14 @@ static void cleanup(int code) #ifdef _WIN32 CloseHandle(exec_mutex); -#ifdef _DEBUG +#if defined(_DEBUG) && defined(_MSC_VER) _CrtMemDumpAllObjectsSince(&mem_chkpoint); if(debug_log!=INVALID_HANDLE_VALUE) { CloseHandle(debug_log); debug_log=INVALID_HANDLE_VALUE; } -#endif // _DEBUG +#endif // _DEBUG && _MSC_VER #endif // _WIN32 pthread_mutex_destroy(&event_mutex); @@ -3174,7 +3174,7 @@ void DLLCALL bbs_thread(void* arg) if(startup->started!=NULL) startup->started(); -#if defined(_WIN32) && defined(_DEBUG) +#if defined(_WIN32) && defined(_DEBUG) && defined(_MSC_VER) sprintf(str,"%sDEBUG.LOG",scfg.data_dir); if((debug_log=CreateFile( @@ -3201,12 +3201,10 @@ void DLLCALL bbs_thread(void* arg) /* Turns on memory leak checking during program termination */ // _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF); -#if defined(_WIN32) /* Save this allocation point for comparison */ _CrtMemCheckpoint(&mem_chkpoint); -#endif -#endif // _WIN32 && _DEBUG +#endif // _WIN32 && _DEBUG && _MSC_VER while(telnet_socket!=INVALID_SOCKET) { diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h index 2c3572e6a575dbfc147d8ef306d44291c3f95162..5edec66bed567287a240572a04a19fc38485c6c6 100644 --- a/src/sbbs3/sbbs.h +++ b/src/sbbs3/sbbs.h @@ -54,7 +54,7 @@ #include <direct.h> /* _mkdir() prototype */ #include <mmsystem.h> /* SND_ASYNC */ - #if defined(_DEBUG) + #if defined(_DEBUG) && defined(_MSC_VER) #include <crtdbg.h> /* Windows debug macros and stuff */ #endif