From 05e608a0c72a5da8cc92a50dd6f79bad046fb977 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 9 Oct 2018 12:58:13 -0400 Subject: [PATCH] stage1 os: workaround for macos not having environ variable --- src/os.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/os.cpp b/src/os.cpp index e1bd6bd479..6df463d8a5 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -71,6 +71,12 @@ static clock_serv_t cclock; #include #include +// Apple doesn't provide the environ global variable +#if defined(__APPLE__) && !defined(environ) +#include +#define environ (*_NSGetEnviron()) +#endif + #if defined(ZIG_OS_POSIX) static void populate_termination(Termination *term, int status) { if (WIFEXITED(status)) {