changeset 17829:ac1b13f881e5

unistd: fix iOS check conditional On Mac OS X 10.8, the TARGET_* macros are unconditonally defined as 0 or 1 in <TargetConditionals.h>, and the previous check always yielded true on non-iOS environment. * lib/unistd.in.h (environ) [__APPLE__]: Check the values of TARGET_OS_IPHONE and TARGET_IPHONE_SIMULATOR, instead of whether they are defined.
author Daiki Ueno <ueno@gnu.org>
date Thu, 11 Dec 2014 16:07:31 +0900
parents 8680c9676a59
children 06d818b9ca43
files ChangeLog lib/unistd.in.h
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-12-11  Daiki Ueno  <ueno@gnu.org>
+
+	unistd: fix iOS check conditional
+	On Mac OS X 10.8, the TARGET_* macros are unconditonally defined
+	as 0 or 1 in <TargetConditionals.h>, and the previous check always
+	yielded true on non-iOS environment.
+	* lib/unistd.in.h (environ) [__APPLE__]: Check the values of
+	TARGET_OS_IPHONE and TARGET_IPHONE_SIMULATOR, instead of whether
+	they are defined.
+
 2014-12-09  Paul Eggert  <eggert@cs.ucla.edu>
 
 	posixtm: avoid compiler warning in a better way
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -402,7 +402,7 @@
    "VARIABLE=VALUE", terminated with a NULL.  */
 #  if defined __APPLE__ && defined __MACH__
 #   include <TargetConditionals.h>
-#   if !defined TARGET_OS_IPHONE && !defined TARGET_IPHONE_SIMULATOR
+#   if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
 #    define _GL_USE_CRT_EXTERNS
 #   endif
 #  endif