Implement getting process executable path.

This commit is contained in:
Bartosz Taudul 2021-01-31 17:37:54 +01:00
parent 6c728f6d23
commit 2890f24c97

View File

@ -278,6 +278,19 @@ static const char* GetProcessName()
return processName; return processName;
} }
static const char* GetProcessExecutablePath()
{
#ifdef _WIN32
static char buf[_MAX_PATH];
GetModuleFileNameA( nullptr, buf, _MAX_PATH );
return buf;
#elif defined _GNU_SOURCE || defined __CYGWIN__
return program_invocation_name;
#else
return nullptr;
#endif
}
#if defined __linux__ && defined __ARM_ARCH #if defined __linux__ && defined __ARM_ARCH
static uint32_t GetHex( char*& ptr, int skip ) static uint32_t GetHex( char*& ptr, int skip )
{ {