mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-23 04:52:07 +00:00
Make SetExecutablePath() on Windows unicode compatible.
This commit is contained in:
parent
a87e34906c
commit
efcaf17f69
1 changed files with 5 additions and 1 deletions
|
@ -57,8 +57,12 @@ static void SetExecutablePath(char* exePath)
|
|||
// !!! this assumes that exePath can hold PATH_MAX chars !!!
|
||||
|
||||
#ifdef _WIN32
|
||||
WCHAR wexePath[PATH_MAX];
|
||||
DWORD len;
|
||||
|
||||
GetModuleFileNameW(NULL, wexePath, PATH_MAX);
|
||||
len = WideCharToMultiByte(CP_UTF8, 0, wexePath, -1, exePath, PATH_MAX, NULL, NULL);
|
||||
|
||||
DWORD len = GetModuleFileNameA(NULL, exePath, PATH_MAX);
|
||||
if(len <= 0 || len == PATH_MAX)
|
||||
{
|
||||
// an error occured, clear exe path
|
||||
|
|
Loading…
Reference in a new issue