changeset 37179:2f93264a07c2

stdio: OS X port of putc_unlocked + extern inline * lib/stdio.in.h (putc_unlocked): #undef on problematic Apple platforms. * doc/posix-functions/putc_unlocked.texi: * doc/posix-functions/putchar_unlocked.texi: Document this portability problem.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 19 Sep 2013 13:25:43 -0700
parents e736826b86c7
children eac494a91a8d
files ChangeLog doc/posix-functions/putc_unlocked.texi doc/posix-functions/putchar_unlocked.texi lib/stdio.in.h
diffstat 4 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Sep 19 13:24:03 2013 -0700
+++ b/ChangeLog	Thu Sep 19 13:25:43 2013 -0700
@@ -1,5 +1,11 @@
 2013-09-19  Paul Eggert  <eggert@cs.ucla.edu>
 
+	stdio: OS X port of putc_unlocked + extern inline
+	* lib/stdio.in.h (putc_unlocked): #undef on problematic Apple platforms.
+	* doc/posix-functions/putc_unlocked.texi:
+	* doc/posix-functions/putchar_unlocked.texi:
+	Document this portability problem.
+
 	signal: OS X port of sigaddset etc. + extern inline
 	* lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset)
 	(sigismember): #undef on problematic Apple platforms.
--- a/doc/posix-functions/putc_unlocked.texi	Thu Sep 19 13:24:03 2013 -0700
+++ b/doc/posix-functions/putc_unlocked.texi	Thu Sep 19 13:25:43 2013 -0700
@@ -8,6 +8,10 @@
 
 Portability problems fixed by Gnulib:
 @itemize
+@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/putchar_unlocked.texi	Thu Sep 19 13:24:03 2013 -0700
+++ b/doc/posix-functions/putchar_unlocked.texi	Thu Sep 19 13:25:43 2013 -0700
@@ -8,6 +8,10 @@
 
 Portability problems fixed by Gnulib:
 @itemize
+@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/stdio.in.h	Thu Sep 19 13:24:03 2013 -0700
+++ b/lib/stdio.in.h	Thu Sep 19 13:25:43 2013 -0700
@@ -124,6 +124,15 @@
 #define _GL_STDIO_STRINGIZE(token) #token
 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
 
+/* 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 __GNUC__ && defined __STDC__)
+# undef putc_unlocked
+#endif
 
 #if @GNULIB_DPRINTF@
 # if @REPLACE_DPRINTF@