bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: fbufmode: Fix compilation error on glibc >= 2.28 systems
Date: Sun, 29 Sep 2019 10:39:46 +0200	[thread overview]
Message-ID: <3131672.42GGDQf4Kk@omega> (raw)

Compiling a gnulib testdir on CentOS 8, I get this compilation error:

../../gllib/fbufmode.c: In function 'fbufmode':
../../gllib/fbufmode.c:43:20: error: '_IO_UNBUFFERED' undeclared (first use in this function)
   if (fp->_flags & _IO_UNBUFFERED)
                    ^~~~~~~~~~~~~~
../../gllib/fbufmode.c:43:20: note: each undeclared identifier is reported only once for each function it appears in
make[4]: *** [Makefile:8935: fbufmode.o] Error 1

This patch fixes it.


diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 4260468..d496257 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -18,11 +18,16 @@
    the same implementation of stdio extension API, except that some fields
    have different naming conventions, or their access requires some casts.  */
 
-/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
-   problem by defining it ourselves.  FIXME: Do not rely on glibc
+/* Glibc 2.28 made _IO_UNBUFFERED and _IO_IN_BACKUP private.  For now, work
+   around this problem by defining them ourselves.  FIXME: Do not rely on glibc
    internals.  */
-#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-# define _IO_IN_BACKUP 0x100
+#if defined _IO_EOF_SEEN
+# if !defined _IO_UNBUFFERED
+#  define _IO_UNBUFFERED 0x2
+# endif
+# if !defined _IO_IN_BACKUP
+#  define _IO_IN_BACKUP 0x100
+# endif
 #endif
 
 /* BSD stdio derived implementations.  */



                 reply	other threads:[~2019-09-29  8:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3131672.42GGDQf4Kk@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).