summaryrefslogtreecommitdiff
path: root/platform/windows/os_windows.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2016-11-28 15:12:54 +0100
committerGitHub <noreply@github.com>2016-11-28 15:12:54 +0100
commitf28ff8a20888f49cc744d0cc3b8455cfb1cf6874 (patch)
tree9767cb3fcf619ac8916a441c1bbe5c707003e455 /platform/windows/os_windows.cpp
parentcefb2de339b3da78bacb80241280987e2a1e2df8 (diff)
Fix console output for MinGW compilers
Reworked patch from @jay3d (#7116).
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r--platform/windows/os_windows.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 3987044d80..04afe63e64 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1329,10 +1329,18 @@ void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) {
MultiByteToWideChar(CP_UTF8,0,buf,len,wbuf,wlen);
wbuf[wlen]=0;
+// Recent MinGW and MSVC compilers seem to disagree on the case here
+#ifdef __MINGW32__
if (p_stderr)
- fwprintf(stderr,L"%s",wbuf);
+ fwprintf(stderr, L"%S", wbuf);
else
- wprintf(L"%s",wbuf);
+ wprintf(L"%S", wbuf);
+#else // MSVC
+ if (p_stderr)
+ fwprintf(stderr, L"%s", wbuf);
+ else
+ wprintf(L"%s", wbuf);
+#endif
#ifdef STDOUT_FILE
//vwfprintf(stdo,p_format,p_list);