<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">See https://github.com/thezbyg/gpick/pull/220

--- source/Paths.cpp.orig	2022-05-08 03:20:36
+++ source/Paths.cpp	2023-05-30 19:26:04
@@ -26,6 +26,9 @@
 #include &lt;iostream&gt;
 #if BOOST_OS_WINDOWS != 0
 #include &lt;windows.h&gt;
+#elif BOOST_OS_MACOS != 0
+#include &lt;mach-o/dyld.h&gt;
+#include &lt;cstring&gt;
 #else
 #include &lt;unistd.h&gt;
 #endif
@@ -61,6 +64,18 @@
 		if (length &lt; buffer.size())
 			return std::string(buffer.begin(), buffer.begin() + length);
 		buffer.resize(buffer.size() * 2);
+	}
+}
+#elif BOOST_OS_MACOS != 0
+static std::string getExecutablePath() {
+	uint32_t bufsize = 4096;
+	std::vector&lt;char&gt; buffer;
+	buffer.resize(bufsize);
+	while (1) {
+		int sizeOk = _NSGetExecutablePath(buffer.data(), &amp;bufsize);
+		if (sizeOk==0)
+			return std::string(buffer.begin(), buffer.begin() + std::strlen(buffer.data()));
+		buffer.resize(bufsize);
 	}
 }
 #else
</pre></body></html>