We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fdc322 commit 365f605Copy full SHA for 365f605
source/Paths.cpp
@@ -26,6 +26,8 @@
26
#include <iostream>
27
#if BOOST_OS_WINDOWS != 0
28
#include <windows.h>
29
+#elif BOOST_OS_MACOS != 0
30
+#include <mach-o/dyld.h>
31
#else
32
#include <unistd.h>
33
#endif
@@ -63,6 +65,17 @@ static std::string getExecutablePath() {
63
65
buffer.resize(buffer.size() * 2);
64
66
}
67
68
69
+static std::string getExecutablePath() {
70
+ uint32_t bufferSize = 4096;
71
+ std::vector<char> buffer;
72
+ buffer.resize(bufferSize);
73
+ while (1) {
74
+ if (_NSGetExecutablePath(buffer.data(), &bufferSize) == 0)
75
+ return buffer.data();
76
77
+ }
78
+}
79
80
#error getExecutablePath not implemented for current OS
81
0 commit comments