stage1 os: workaround for macos not having environ variable

master
Andrew Kelley 2018-10-09 12:58:13 -04:00
parent e29a3b1d2a
commit 05e608a0c7
No known key found for this signature in database
GPG Key ID: 4E7CD66038A4D47C
1 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,12 @@ static clock_serv_t cclock;
#include <errno.h>
#include <time.h>
// Apple doesn't provide the environ global variable
#if defined(__APPLE__) && !defined(environ)
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
#endif
#if defined(ZIG_OS_POSIX)
static void populate_termination(Termination *term, int status) {
if (WIFEXITED(status)) {