Skip to content

Commit

Permalink
dlerror Win compat: use FormatMessageA explicitly
Browse files Browse the repository at this point in the history
With current flags, -DUNICODE is defined, thus compiling preview.cpp
using wide function (FormatMessageW) implicitly, thus use FormatMessageA
explicitly.
  • Loading branch information
MartinPulec committed Mar 23, 2022
1 parent a9e6e05 commit d858961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d858961

Please sign in to comment.