mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Fix UNICODE issue of dlerror
Current implementation is conflicting. If UNICODE is defined, FormatMessage() will be FormatMessageW(), and variable win_errormsg with type char can not be passed to it, which should be changed to TCHAR instead. Since we don't use UNICODE here, we can use FormatMessageA() directly to avoid conversion error. ``` my_global.h(1092): error C2664: 'DWORD FormatMessageW(D WORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,va_list *)' : cannot convert argument 5 from 'char [2048]' to 'LPWSTR' ```
This commit is contained in:
parent
d956709b4b
commit
9eadef013e
1 changed files with 1 additions and 1 deletions
|
@ -1077,7 +1077,7 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
|
|||
static inline char *dlerror(void)
|
||||
{
|
||||
static char win_errormsg[2048];
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
0, GetLastError(), 0, win_errormsg, 2048, NULL);
|
||||
return win_errormsg;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue