mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-17 00:33:33 +00:00
Fixed issue related to Apple Silicon
This commit is contained in:
@@ -5486,7 +5486,7 @@ int MeshAgent_Start(MeshAgentHostContainer *agentHost, int paramLen, char **para
|
|||||||
WideCharToMultiByte(CP_UTF8, 0, (LPCWCH)tmpExePath, -1, (LPSTR)exePath, (int)ILibMemory_Size(exePath), NULL, NULL);
|
WideCharToMultiByte(CP_UTF8, 0, (LPCWCH)tmpExePath, -1, (LPSTR)exePath, (int)ILibMemory_Size(exePath), NULL, NULL);
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
if (_NSGetExecutablePath(exePath, &len) != 0) ILIBCRITICALEXIT(247);
|
if (_NSGetExecutablePath(exePath, &len) != 0) ILIBCRITICALEXIT(247);
|
||||||
exePath[(int)len] = 0;
|
|
||||||
agentHost->exePath = exePath;
|
agentHost->exePath = exePath;
|
||||||
#elif defined(NACL)
|
#elif defined(NACL)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ void ILibDuktape_ScriptContainer_CheckEmbedded(char **script, int *scriptLen)
|
|||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
char exePath[_MAX_PATH*2];
|
char exePath[_MAX_PATH*2];
|
||||||
#else
|
#else
|
||||||
char exePath[PATH_MAX+1];
|
char exePath[PATH_MAX+1] = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -443,7 +443,7 @@ void ILibDuktape_ScriptContainer_CheckEmbedded(char **script, int *scriptLen)
|
|||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
uint32_t len = sizeof(exePath);
|
uint32_t len = sizeof(exePath);
|
||||||
if (_NSGetExecutablePath(exePath, &len) != 0) ILIBCRITICALEXIT(247);
|
if (_NSGetExecutablePath(exePath, &len) != 0) ILIBCRITICALEXIT(247);
|
||||||
exePath[len] = 0;
|
|
||||||
#elif defined(NACL)
|
#elif defined(NACL)
|
||||||
#elif defined(_FREEBSD)
|
#elif defined(_FREEBSD)
|
||||||
int x = readlink("/proc/curproc/file", exePath, sizeof(exePath));
|
int x = readlink("/proc/curproc/file", exePath, sizeof(exePath));
|
||||||
|
|||||||
Reference in New Issue
Block a user