summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
Diffstat (limited to 'gl')
-rw-r--r--gl/unistd.in.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 6c1506b8b7..1aae789afe 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -401,6 +401,13 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
/* Set of environment variables and values. An array of strings of the form
"VARIABLE=VALUE", terminated with a NULL. */
# if defined __APPLE__ && defined __MACH__
+# include "TargetConditionals.h"
+# if !defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR)
+# define APPLE_USE_CRT_EXTERNS
+# endif
+# endif
+#
+# ifdef APPLE_USE_CRT_EXTERNS
# include <crt_externs.h>
# define environ (*_NSGetEnviron ())
# else