Add base bat call for mac os
This commit is contained in:
parent
3a7e74938e
commit
e2a9cf05ac
|
@ -70,11 +70,20 @@ int main(int argc, const char** argv)
|
|||
}
|
||||
|
||||
DWORD length = ::GetModuleFileNameA(NULL, basePath, sizeof(basePath));
|
||||
#else
|
||||
#ifdef __APPLE__
|
||||
uint32_t length = sizeof(basePath);
|
||||
|
||||
if (_NSGetExecutablePath(basePath, &length) != 0) {
|
||||
// Buffer size is too small.
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
int length = readlink("/proc/self/exe", basePath, sizeof(basePath));
|
||||
|
||||
// strcpy(basePath, argv[0]);
|
||||
// int length = strlen(basePath);
|
||||
#endif
|
||||
#endif
|
||||
while (length > 0 && basePath[length - 1] != '/' && basePath[length - 1] != '\\')
|
||||
length--;
|
||||
|
|
Loading…
Reference in New Issue