]> Savannah Git Hosting - gnulib.git/commitdiff
stdioext: Avoid compilation errors on UnixWare 7.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Oct 2020 13:24:52 +0000 (15:24 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Oct 2020 13:24:52 +0000 (15:24 +0200)
Reported by Tim Rice <tim@multitalents.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00127.html>.

* lib/fbufmode.c: Don't include <stdio_ext.h> if it does not exist.
* lib/fpurge.c: Likewise.
* lib/freadable.h: Likewise.
* lib/freading.h: Likewise.
* lib/fwritable.h: Likewise.
* lib/fwriting.h: Likewise.
* m4/fbufmode.m4 (gl_FUNC_FBUFMODE): Test whether <stdio_ext.h> exists.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Likewise.
* m4/freadable.m4 (gl_FUNC_FREADABLE): Likewise.
* m4/freading.m4 (gl_FUNC_FREADING): Likewise.
* m4/fwritable.m4 (gl_FUNC_FWRITABLE): Likewise.
* m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise.

13 files changed:
ChangeLog
lib/fbufmode.c
lib/fpurge.c
lib/freadable.h
lib/freading.h
lib/fwritable.h
lib/fwriting.h
m4/fbufmode.m4
m4/fpurge.m4
m4/freadable.m4
m4/freading.m4
m4/fwritable.m4
m4/fwriting.m4

index defa84ad2a5bdefcc9c20f440172813607fd50d7..070929e37c1f6a67e62476e99e185a447d5c0341 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2020-10-11  Bruno Haible  <bruno@clisp.org>
+
+       stdioext: Avoid compilation errors on UnixWare 7.
+       Reported by Tim Rice <tim@multitalents.net> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00127.html>.
+       * lib/fbufmode.c: Don't include <stdio_ext.h> if it does not exist.
+       * lib/fpurge.c: Likewise.
+       * lib/freadable.h: Likewise.
+       * lib/freading.h: Likewise.
+       * lib/fwritable.h: Likewise.
+       * lib/fwriting.h: Likewise.
+       * m4/fbufmode.m4 (gl_FUNC_FBUFMODE): Test whether <stdio_ext.h> exists.
+       * m4/fpurge.m4 (gl_FUNC_FPURGE): Likewise.
+       * m4/freadable.m4 (gl_FUNC_FREADABLE): Likewise.
+       * m4/freading.m4 (gl_FUNC_FREADING): Likewise.
+       * m4/fwritable.m4 (gl_FUNC_FWRITABLE): Likewise.
+       * m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise.
+
 2020-10-11  Bruno Haible  <bruno@clisp.org>
 
        stdioext: Update comments regarding Cygwin.
index 65a5cfc821e667d7e2eb505c391355113a475cd8..a528a63e35f37eed0e5e245821c742653749bae1 100644 (file)
@@ -20,7 +20,9 @@
 #include "fbufmode.h"
 
 #if HAVE___FLBF
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 #endif
 
 #include "stdio-impl.h"
index fc88646ca430feeaa3e0d460a81a36d1d9721b1f..9469ce43ca15720d9258ae503370082dd4bacec8 100644 (file)
 /* Specification.  */
 #include <stdio.h>
 
-#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, Cygwin >= 1.7.10, Android API >= 23 */
-# include <stdio_ext.h>
+#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, Cygwin >= 1.7.10, Android API >= 23, musl libc */
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 #endif
 #include <stdlib.h>
 
index f05e5fb3975aef774b636e58ae309c08e9186cf8..91398650233e4171573af1ebf84fb764626a61bc 100644 (file)
@@ -24,7 +24,9 @@
 
 #if HAVE___FREADABLE /* glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 23, musl libc */
 
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 # define freadable(stream) (__freadable (stream) != 0)
 
 #else
index 1891f5af4f1f20721f1fa9a83160d47044e75349..7bef18ede9baefa80b34e0a5add156fdaf6b70d2 100644 (file)
@@ -35,7 +35,9 @@
 #if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
 /* Solaris >= 7, Cygwin >= 1.7.34, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc  */
 
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 # define freading(stream) (__freading (stream) != 0)
 
 #else
index 509e069528e8137cf01364721fae79b94ba6735c..fb9c871efa2080aedcdd666272a28bf03ac628bb 100644 (file)
@@ -24,7 +24,9 @@
 
 #if HAVE___FWRITABLE /* glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 23, musl libc */
 
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 # define fwritable(stream) (__fwritable (stream) != 0)
 
 #else
index 2d16f42d47eabbe5f3e89f3096cd5224e5a89f12..3aa5d7f0eeb5263926367f378d0c76e22ca4c598 100644 (file)
@@ -35,7 +35,9 @@
 
 #if HAVE___FWRITING /* glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 29, musl libc */
 
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 # define fwriting(stream) (__fwriting (stream) != 0)
 
 #else
index 87e76e0d7b4f8a39fa4872941869188d9b91fb68..e2a146fa29d7f0773475a6527412dd0985b80ee9 100644 (file)
@@ -1,4 +1,4 @@
-# fbufmode.m4 serial 2
+# fbufmode.m4 serial 3
 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,5 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FBUFMODE],
 [
   dnl Prerequisites of lib/fbufmode.c.
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([__flbf __fbufsize])
 ])
index 0796a6f0edda2ad8eea6f45bc9cfa989019c88fb..9a486e00a46365b513f60a8e9b2308f1b07e1317 100644 (file)
@@ -1,4 +1,4 @@
-# fpurge.m4 serial 11
+# fpurge.m4 serial 12
 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_FPURGE],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([fpurge])
   AC_CHECK_FUNCS_ONCE([__fpurge])
   AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
index 3237effe024f3597672d39a7b7b801285b0ae85b..e988054374df399c6b77d580aea77955557a62f7 100644 (file)
@@ -1,4 +1,4 @@
-# freadable.m4 serial 2
+# freadable.m4 serial 3
 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FREADABLE],
 [
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([__freadable])
 ])
index 440c241e47e6e70bf201819d271f86c6bae0179b..6eb25abfa2a7ac1296eb9fce71392025f286951f 100644 (file)
@@ -1,4 +1,4 @@
-# freading.m4 serial 1
+# freading.m4 serial 2
 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FREADING],
 [
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([__freading])
 ])
index dbe887e8866bcb57d5a8b4dd44a3b0595a1f52f7..55db08f87e3dcce242b84099ba233e9fea036eef 100644 (file)
@@ -1,4 +1,4 @@
-# fwritable.m4 serial 2
+# fwritable.m4 serial 3
 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FWRITABLE],
 [
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([__fwritable])
 ])
index 4d7cd3ede1abae3457806d1977d74d80afbaa34e..fe2f10ea2719e0f69d02bb106fb438234f162cfb 100644 (file)
@@ -1,4 +1,4 @@
-# fwriting.m4 serial 2
+# fwriting.m4 serial 3
 dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FWRITING],
 [
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([__fwriting])
 ])