dlerror Win compat: use FormatMessageA explicitly

With current flags, -DUNICODE is defined, thus compiling preview.cpp
using wide function (FormatMessageW) implicitly, thus use FormatMessageA
explicitly.
This commit is contained in:
Martin Pulec
2022-03-09 16:11:47 +01:00
parent a9e6e05b75
commit d858961344

View File

@@ -55,7 +55,7 @@ static char *dlerror(void) ATTRIBUTE(unused);
static char *dlerror(void) {
thread_local static char buf[1024] = "(unknown)";
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, // flags
FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, // flags
NULL, // lpsource
GetLastError(), // message id
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), // languageid