mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 16:54:42 +00:00
Codechange: [Win32] Use a local buffer to store the output text of DEBUG() to make the call thread-safe.
This commit is contained in:
parent
e1a164b531
commit
3fc9c9522d
@ -17,6 +17,10 @@
|
|||||||
#include "fileio_func.h"
|
#include "fileio_func.h"
|
||||||
#include "settings_type.h"
|
#include "settings_type.h"
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(WIN64)
|
||||||
|
#include "os/windows/win32.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if defined(ENABLE_NETWORK)
|
#if defined(ENABLE_NETWORK)
|
||||||
@ -136,7 +140,9 @@ static void debug_print(const char *dbg, const char *buf)
|
|||||||
char buffer[512];
|
char buffer[512];
|
||||||
seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
|
seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
|
||||||
#if defined(WIN32) || defined(WIN64)
|
#if defined(WIN32) || defined(WIN64)
|
||||||
_fputts(OTTD2FS(buffer, true), stderr);
|
TCHAR system_buf[512];
|
||||||
|
convert_to_fs(buffer, system_buf, lengthof(system_buf), true);
|
||||||
|
_fputts(system_buf, stderr);
|
||||||
#else
|
#else
|
||||||
fputs(buffer, stderr);
|
fputs(buffer, stderr);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user