Paul Eggert <egg...@cs.ucla.edu> writes: > 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. > --- > ChangeLog | 7 +++++++ > lib/unistd.in.h | 6 ++++++ > 2 files changed, 13 insertions(+)
[...] > diff --git a/lib/unistd.in.h b/lib/unistd.in.h > index bfa9578..b4a3f5b 100644 > --- a/lib/unistd.in.h > +++ b/lib/unistd.in.h > @@ -401,6 +401,12 @@ _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 I've just noticed that this broke envvar passing of msgexec/msgfilter on Mac OS X 10.8. Looking at <TargetConditionals.h>, those macros are unconditionally defined as 0 or 1. I'm attaching a fix (tested on my environment). Regards, -- Daiki Ueno
>From 5b0fe63a5ba1a271d56a2d74112d473286dbb69a Mon Sep 17 00:00:00 2001 From: Daiki Ueno <u...@gnu.org> Date: Thu, 11 Dec 2014 16:07:31 +0900 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ lib/unistd.in.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5fac19d..2336ee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-12-11 Daiki Ueno <u...@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 <egg...@cs.ucla.edu> posixtm: avoid compiler warning in a better way diff --git a/lib/unistd.in.h b/lib/unistd.in.h index b4a3f5b..7907f83 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 <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 -- 2.1.0