Changed GetModuleFileName calls to GetModuleFileNameA to ensure that the 8 bit character version is used. Fixes build errors with Qt6 using C++17.

This commit is contained in:
mjbudd77 2021-04-12 06:27:04 -04:00
parent c1d6d7f4cf
commit 904652efa9
3 changed files with 3 additions and 3 deletions

View File

@ -238,7 +238,7 @@ int fceuExecutablePath( char *outputPath, int outputSize )
char directory[2048];
char finalPath[2048];
GetModuleFileName(NULL, fullPath, 2048);
GetModuleFileNameA(NULL, fullPath, 2048);
_splitpath(fullPath, driveLetter, directory, NULL, NULL);
snprintf(finalPath, sizeof(finalPath), "%s%s", driveLetter, directory);
strncpy( outputPath, finalPath, outputSize );

View File

@ -390,7 +390,7 @@ GetBaseDirectory(std::string &dir)
} else {
#ifdef WIN32
home = new char[MAX_PATH + 1];
GetModuleFileName(NULL, home, MAX_PATH + 1);
GetModuleFileNameA(NULL, home, MAX_PATH + 1);
char *lastBS = strrchr(home,'\\');
if(lastBS) {

View File

@ -551,7 +551,7 @@ static int emu_getdir(lua_State *L) {
char directory[2048];
char finalPath[2048];
GetModuleFileName(NULL, fullPath, 2048);
GetModuleFileNameA(NULL, fullPath, 2048);
_splitpath(fullPath, driveLetter, directory, NULL, NULL);
snprintf(finalPath, sizeof(finalPath), "%s%s", driveLetter, directory);
lua_pushstring(L, finalPath);