langpackedit: sorting fixes, 0.015 -- from 8f06f769
[wdl.git] / WDL / win32_printf.h
blob701e4d83d91a6cecc4592992dd06f60c86fd1db2
1 #ifndef _WDL_WIN32_PRINTF_H_
2 #define _WDL_WIN32_PRINTF_H_
4 #include <windows.h>
5 #ifdef printf
6 #undef printf
7 #endif
8 #define printf wdl_printf
10 // this file is designed to be temporarily included when printf() debugging on win32
13 static void wdl_printf(const char *format, ...)
15 char tmp[3800];
16 int rv;
17 va_list va;
18 va_start(va,format);
19 tmp[0]=0;
20 rv=_vsnprintf(tmp,sizeof(tmp),format,va); // returns -1 if over, and does not null terminate, ugh
21 va_end(va);
23 if (rv < 0 || rv>=(int)sizeof(tmp)-1) tmp[sizeof(tmp)-1]=0;
24 OutputDebugStringA(tmp);
27 #endif