Enable the use of __freading for glibc >= 2.7.
authorBruno Haible <bruno@clisp.org>
Sat, 13 Oct 2007 11:24:03 +0000 (13:24 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 13 Oct 2007 11:29:15 +0000 (13:29 +0200)
ChangeLog
lib/freading.c
lib/freading.h

index a91048b..93bcb04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-13  Bruno Haible  <bruno@clisp.org>
+
+       * lib/freading.h (freading): Enable the use of __freading for
+       glibc >= 2.7.
+       * lib/freading.c (freading): Likewise.
+
 2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/argp-fmtstream.h (ARGP_FS_EI): Work around GCC 4.2.1 diagnostic
index cbe4d7e..a2c6fe6 100644 (file)
@@ -19,9 +19,9 @@
 /* Specification.  */
 #include "freading.h"
 
-/* Don't use glibc's __freading function, see
+/* Don't use glibc's __freading function in glibc < 2.7, see
    <http://sourceware.org/bugzilla/show_bug.cgi?id=4359>  */
-#if !(HAVE___FREADING && !defined __GLIBC__)
+#if !(HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
 
 bool
 freading (FILE *fp)
index a4f682d..bf67b07 100644 (file)
@@ -32,7 +32,8 @@
 
    STREAM must not be wide-character oriented.  */
 
-#if HAVE___FREADING && !defined __GLIBC__ /* Solaris >= 7, not glibc >= 2.2  */
+#if HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
+/* Solaris >= 7, not glibc >= 2.2, but glibc >= 2.7  */
 
 # include <stdio_ext.h>
 # define freading(stream) (__freading (stream) != 0)