Changeset - r22873:025d4805a116
[Not reviewed]
master
0 1 0
Michael Lutz - 6 years ago 2018-05-20 01:15:22
michi@icosahedron.de
Codechange: [Win32] Use a local buffer to store the output text of DEBUG() to make the call thread-safe.
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/debug.cpp
Show inline comments
 
@@ -17,6 +17,10 @@
 
#include "fileio_func.h"
 
#include "settings_type.h"
 

	
 
#if defined(WIN32) || defined(WIN64)
 
#include "os/windows/win32.h"
 
#endif
 

	
 
#include <time.h>
 

	
 
#if defined(ENABLE_NETWORK)
 
@@ -136,7 +140,9 @@ static void debug_print(const char *dbg,
 
		char buffer[512];
 
		seprintf(buffer, lastof(buffer), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
 
#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
 
		fputs(buffer, stderr);
 
#endif
0 comments (0 inline, 0 general)