From 6f3c76e0dc5cb93b7e0d1db77143ad9ef2e773b7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 19 Sep 2013 13:25:43 -0700 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ doc/posix-functions/putc_unlocked.texi | 4 ++++ doc/posix-functions/putchar_unlocked.texi | 4 ++++ lib/stdio.in.h | 9 +++++++++ 4 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 26ddec97d..b0cd23677 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2013-09-19 Paul Eggert + 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. diff --git a/doc/posix-functions/putc_unlocked.texi b/doc/posix-functions/putc_unlocked.texi index 663bfdf39..68f9d2c05 100644 --- a/doc/posix-functions/putc_unlocked.texi +++ b/doc/posix-functions/putc_unlocked.texi @@ -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: diff --git a/doc/posix-functions/putchar_unlocked.texi b/doc/posix-functions/putchar_unlocked.texi index f0fe807eb..d307fe5c1 100644 --- a/doc/posix-functions/putchar_unlocked.texi +++ b/doc/posix-functions/putchar_unlocked.texi @@ -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: diff --git a/lib/stdio.in.h b/lib/stdio.in.h index d945d5ceb..232fd988a 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -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., + . + 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@ -- 2.11.0