From: Daiki Ueno Date: Thu, 11 Dec 2014 07:07:31 +0000 (+0900) Subject: unistd: fix iOS check conditional X-Git-Tag: v1.0~7229 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=73991ca4ba667724ea90f5603ba2161c7382b902;p=gnulib.git unistd: fix iOS check conditional On Mac OS X 10.8, the TARGET_* macros are unconditonally defined as 0 or 1 in , 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. --- diff --git a/ChangeLog b/ChangeLog index 5fac19d58b..2336ee5828 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-12-11 Daiki Ueno + + unistd: fix iOS check conditional + On Mac OS X 10.8, the TARGET_* macros are unconditonally defined + as 0 or 1 in , 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 posixtm: avoid compiler warning in a better way diff --git a/lib/unistd.in.h b/lib/unistd.in.h index b4a3f5b312..7907f832c9 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -402,7 +402,7 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - " "VARIABLE=VALUE", terminated with a NULL. */ # if defined __APPLE__ && defined __MACH__ # include -# if !defined TARGET_OS_IPHONE && !defined TARGET_IPHONE_SIMULATOR +# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR # define _GL_USE_CRT_EXTERNS # endif # endif