update std lib to integrate with libc for environ

closes #3511
This commit is contained in:
Andrew Kelley
2020-02-22 15:59:13 -05:00
parent 0cd89e9176
commit 936d0b18b1
5 changed files with 78 additions and 22 deletions

View File

@@ -81,11 +81,7 @@ static clock_serv_t macos_monotonic_clock;
#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())
#elif defined(ZIG_OS_FREEBSD) || defined(ZIG_OS_NETBSD) || defined(ZIG_OS_DRAGONFLY)
#if !defined(environ)
extern char **environ;
#endif