wchar.h instead cwchar when compiler is MinGW to prevent weird behavior with vsnwprintf

This commit is contained in:
IceNinjaman 2019-02-28 14:01:19 +01:00 committed by GitHub
parent c59fd6df20
commit 90a93025c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,6 @@
#define NOIME
#include <windows.h>
#include <psapi.h>
#include <cwchar>
#include <cstdio>
/**
@ -20,6 +19,7 @@
* The entire function is rewritten
*/
#ifdef __MINGW32__
#include <wchar.h>
/// strsafe.h fixes
static HRESULT StringCbPrintfW(LPWSTR pszDest, size_t cbDest, LPCWSTR pszFormat, ...)
{
@ -34,6 +34,7 @@ static HRESULT StringCbPrintfW(LPWSTR pszDest, size_t cbDest, LPCWSTR pszFormat,
return ret;
}
#else
#include <cwchar>
#include <strsafe.h>
#endif // __MINGW32__