stdio: OS X port of putc_unlocked + extern inline
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Sep 2013 20:25:43 +0000 (13:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Sep 2013 21:33:07 +0000 (14:33 -0700)
* 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.

ChangeLog
doc/posix-functions/putc_unlocked.texi
doc/posix-functions/putchar_unlocked.texi
lib/stdio.in.h

index 26ddec9..b0cd236 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 663bfdf..68f9d2c 100644 (file)
@@ -8,6 +8,10 @@ Gnulib module: ---
 
 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:
index f0fe807..d307fe5 100644 (file)
@@ -8,6 +8,10 @@ Gnulib module: ---
 
 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:
index d945d5c..232fd98 100644 (file)
 #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@