+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.
#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"
/* 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>
#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
#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
#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
#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
-# 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,
AC_DEFUN([gl_FUNC_FBUFMODE],
[
dnl Prerequisites of lib/fbufmode.c.
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__flbf __fbufsize])
])
-# 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,
[
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>]])
-# 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,
AC_DEFUN([gl_FUNC_FREADABLE],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__freadable])
])
-# 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,
AC_DEFUN([gl_FUNC_FREADING],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__freading])
])
-# 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,
AC_DEFUN([gl_FUNC_FWRITABLE],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__fwritable])
])
-# 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,
AC_DEFUN([gl_FUNC_FWRITING],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__fwriting])
])