add second function for getexepath

This commit is contained in:
Markus 2019-08-22 13:06:38 +02:00
parent c21df9cdfa
commit 3693cf7658
1 changed files with 8 additions and 1 deletions

View File

@ -995,11 +995,18 @@ std::string getexepath()
ssize_t count = readlink( "/proc/self/exe", result, PATH_MAX );
return std::string( result, (count > 0) ? static_cast<size_t>(count) : 0 );
#endif
#ifdef _WIN32
#ifdef V2
char buffer[MAX_PATH];
GetModuleFileName( NULL, buffer, MAX_PATH );
return buffer;
#endif
#ifdef _WIN32
wchar_t buffer[MAX_PATH];
char CharArray[MAX_PATH + 1];
memset( CharArray, 0, MAX_PATH + 1);
GetModuleFileName( nullptr, buffer, MAX_PATH );
wcstombs(CharArray, buffer, MAX_PATH + 1);
#endif
}

void setPathSymbol(Settings &settings)