From: Michael Lee Date: Tue, 31 Jan 2017 00:00:33 +0000 (-0800) Subject: crt_externs.h is not available on all platforms X-Git-Tag: v2017.03.06.00~68 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0cd1f8475c9cff8aaf102204d72ded2fdd9e9fb4;p=folly.git crt_externs.h is not available on all platforms Summary: Different deployments of don't always have access to crt_externs.h. Reviewed By: yfeldblum, Orvid Differential Revision: D4480621 fbshipit-source-id: f0b18d15fa253d6ba28dee68859cf9a34bf41255 --- diff --git a/folly/portability/Stdlib.h b/folly/portability/Stdlib.h index 9b16d760..c3bf7340 100644 --- a/folly/portability/Stdlib.h +++ b/folly/portability/Stdlib.h @@ -18,13 +18,6 @@ #include -#if defined(__APPLE__) -#include -#if (TARGET_OS_OSX || TARGET_OS_SIMULATOR) -#include -#endif -#endif - extern "C" { #ifdef _WIN32 // These are technically supposed to be defined linux/limits.h and @@ -41,7 +34,7 @@ int mkstemp(char* tn); char* realpath(const char* path, char* resolved_path); int setenv(const char* name, const char* value, int overwrite); int unsetenv(const char* name); -#elif defined(__APPLE__) && (TARGET_OS_OSX || TARGET_OS_SIMULATOR) -#define environ (*_NSGetEnviron()) +#elif defined(__APPLE__) +extern char** environ; #endif }