|
|
@ -145,6 +145,8 @@ int GetRandInt(int nMax) |
|
|
|
|
|
|
|
|
|
|
|
inline int OutputDebugStringF(const char* pszFormat, ...) |
|
|
|
inline int OutputDebugStringF(const char* pszFormat, ...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
static CCriticalSection cs_OutputDebugStringF; |
|
|
|
|
|
|
|
|
|
|
|
int ret = 0; |
|
|
|
int ret = 0; |
|
|
|
if (fPrintToConsole) |
|
|
|
if (fPrintToConsole) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -155,6 +157,8 @@ inline int OutputDebugStringF(const char* pszFormat, ...) |
|
|
|
va_end(arg_ptr); |
|
|
|
va_end(arg_ptr); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CRITICAL_BLOCK(cs_OutputDebugStringF) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// print to debug.log
|
|
|
|
// print to debug.log
|
|
|
|
static FILE* fileout = NULL; |
|
|
|
static FILE* fileout = NULL; |
|
|
@ -181,12 +185,12 @@ inline int OutputDebugStringF(const char* pszFormat, ...) |
|
|
|
fflush(fileout); |
|
|
|
fflush(fileout); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef __WXMSW__ |
|
|
|
#ifdef __WXMSW__ |
|
|
|
if (fPrintToDebugger) |
|
|
|
if (fPrintToDebugger) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// accumulate a line at a time
|
|
|
|
// accumulate a line at a time
|
|
|
|
static CCriticalSection cs_OutputDebugStringF; |
|
|
|
|
|
|
|
CRITICAL_BLOCK(cs_OutputDebugStringF) |
|
|
|
CRITICAL_BLOCK(cs_OutputDebugStringF) |
|
|
|
{ |
|
|
|
{ |
|
|
|
static char pszBuffer[50000]; |
|
|
|
static char pszBuffer[50000]; |
|
|
|