changeset 37178:e736826b86c7

signal: OS X port of sigaddset etc. + extern inline * lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset) (sigismember): #undef on problematic Apple platforms. * doc/posix-functions/sigaddset.texi: * doc/posix-functions/sigdelset.texi: * doc/posix-functions/sigemptyset.texi: * doc/posix-functions/sigfillset.texi: * doc/posix-functions/sigismember.texi: Document this portability problem.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 19 Sep 2013 13:24:03 -0700
parents c151363623ef
children 2f93264a07c2
files ChangeLog doc/posix-functions/sigaddset.texi doc/posix-functions/sigdelset.texi doc/posix-functions/sigemptyset.texi doc/posix-functions/sigfillset.texi doc/posix-functions/sigismember.texi lib/signal.in.h
diffstat 7 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Sep 19 13:21:39 2013 -0700
+++ b/ChangeLog	Thu Sep 19 13:24:03 2013 -0700
@@ -1,5 +1,15 @@
 2013-09-19  Paul Eggert  <eggert@cs.ucla.edu>
 
+	signal: OS X port of sigaddset etc. + extern inline
+	* lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset)
+	(sigismember): #undef on problematic Apple platforms.
+	* doc/posix-functions/sigaddset.texi:
+	* doc/posix-functions/sigdelset.texi:
+	* doc/posix-functions/sigemptyset.texi:
+	* doc/posix-functions/sigfillset.texi:
+	* doc/posix-functions/sigismember.texi:
+	Document this portability problem.
+
 	extern-inline: do not always suppress extern inline on OS X
 	* m4/extern-inline.m4 (gl_EXTERN_INLINE): Suppress the use of
 	extern inline on Apple only if the particular compile-time
--- a/doc/posix-functions/sigaddset.texi	Thu Sep 19 13:21:39 2013 -0700
+++ b/doc/posix-functions/sigaddset.texi	Thu Sep 19 13:24:03 2013 -0700
@@ -11,6 +11,10 @@
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/doc/posix-functions/sigdelset.texi	Thu Sep 19 13:21:39 2013 -0700
+++ b/doc/posix-functions/sigdelset.texi	Thu Sep 19 13:24:03 2013 -0700
@@ -11,6 +11,10 @@
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/doc/posix-functions/sigemptyset.texi	Thu Sep 19 13:21:39 2013 -0700
+++ b/doc/posix-functions/sigemptyset.texi	Thu Sep 19 13:24:03 2013 -0700
@@ -11,6 +11,10 @@
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/doc/posix-functions/sigfillset.texi	Thu Sep 19 13:21:39 2013 -0700
+++ b/doc/posix-functions/sigfillset.texi	Thu Sep 19 13:24:03 2013 -0700
@@ -11,6 +11,10 @@
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/doc/posix-functions/sigismember.texi	Thu Sep 19 13:21:39 2013 -0700
+++ b/doc/posix-functions/sigismember.texi	Thu Sep 19 13:24:03 2013 -0700
@@ -11,6 +11,10 @@
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/lib/signal.in.h	Thu Sep 19 13:21:39 2013 -0700
+++ b/lib/signal.in.h	Thu Sep 19 13:24:03 2013 -0700
@@ -195,6 +195,20 @@
 
 # endif
 
+/* When also using extern inline, suppress the use of static inline in
+   standard headers of problematic Apple configurations, as Libc at
+   least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+     && (defined __i386__ || defined __x86_64__))
+# undef sigaddset
+# undef sigdelset
+# undef sigemptyset
+# undef sigfillset
+# undef sigismember
+#endif
+
 /* Test whether a given signal is contained in a signal set.  */
 # if @HAVE_POSIX_SIGNALBLOCKING@
 /* This function is defined as a macro on Mac OS X.  */