changeset 17796:e6ce17a54483

unistd: port to iOS Problem reported by André Klitzing in: http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00013.html * lib/unistd.in.h (environ): Do not include crt_externs.h on iOS.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 06 Nov 2014 20:33:02 -0800
parents 5c5dad428438
children dffad0ca4bc1
files ChangeLog lib/unistd.in.h
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-11-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+	unistd: port to iOS
+	Problem reported by André Klitzing in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2014-11/msg00013.html
+	* lib/unistd.in.h (environ): Do not include crt_externs.h on iOS.
+
 2014-11-05  Paul Eggert  <eggert@cs.ucla.edu>
 
 	obstack: do not reject malloc-style obstack_chunkfun, obstack_freefun
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -401,6 +401,12 @@
 /* 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 _GL_USE_CRT_EXTERNS
+#   endif
+#  endif
+#  ifdef _GL_USE_CRT_EXTERNS
 #   include <crt_externs.h>
 #   define environ (*_NSGetEnviron ())
 #  else