We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c622c66 commit 6e7914cCopy full SHA for 6e7914c
Utilities/FileSystem.h
@@ -13,6 +13,9 @@
13
#include <unistd.h>
14
#include <dirent.h>
15
#endif
16
+#ifdef __APPLE__
17
+#include <mach-o/dyld.h>
18
+#endif
19
20
#ifndef S_ISDIR
21
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
@@ -217,6 +220,9 @@ namespace Utilities
217
220
char buffer[1000];
218
221
#ifdef WIN32
219
222
GetModuleFileName(NULL, buffer, 1000);
223
+#elif defined(__APPLE__)
224
+ uint32_t bufferSize = sizeof(buffer);
225
+ _NSGetExecutablePath(buffer, &bufferSize);
226
#else
227
char szTmp[32];
228
sprintf(szTmp, "/proc/%d/exe", getpid());
0 commit comments