* patch: stdio fiex for UnixWare
@ 2020-09-24 20:49 Tim Rice
2020-09-24 23:08 ` Paul Eggert
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Tim Rice @ 2020-09-24 20:49 UTC (permalink / raw)
To: bug-gnulib
[-- Attachment #1: Type: TEXT/PLAIN, Size: 247 bytes --]
I've attached a patch to address the fact that UnixWare does not have
stdio_ext.h but has some __X() stdio helper functions.
Wrap "#include <stdio_ext.h>" in HAVE_STDIO_EXT_H insead of HAVE___X
--
Tim Rice Multitalents
tim@multitalents.net
[-- Attachment #2: stdio_ext.patch --]
[-- Type: TEXT/PLAIN, Size: 5532 bytes --]
diff --git a/ChangeLog b/ChangeLog
index 5c4d8f849..51e074bd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2020-09-24 Tim Rice <tim@multitalents.net>
+ UnixWare does not have stdio_ext.h but has some __X() stdio
+ helper functions.
+ * lib/fbufmode.c: Wrap "#include <stdio_ext.h>" in HAVE_STDIO_EXT_H
+ * lib/fpurge.c: Likewise.
+ * lib/freadable.h: Likewise.
+ * lib/freadahead.h: Likewise.
+ * lib/freading.h: Likewise.
+ * lib/freadptr.h: Likewise.
+ * lib/fseterr.h: Likewise.
+ * lib/fwritable.h: Likewise.
+ * lib/fwriting.h: Likewise.
+
2020-09-23 Paul Eggert <eggert@cs.ucla.edu>
regex: fix ignore-case Turkish bug
diff --git a/lib/fbufmode.c b/lib/fbufmode.c
index 65a5cfc82..ec8afd510 100644
--- a/lib/fbufmode.c
+++ b/lib/fbufmode.c
@@ -19,7 +19,7 @@
/* Specification. */
#include "fbufmode.h"
-#if HAVE___FLBF
+#if HAVE_STDIO_EXT_H
# include <stdio_ext.h>
#endif
@@ -61,7 +61,7 @@ fbufmode (FILE *fp)
else
return _IONBF;
# else
-# if HAVE___FLBF /* Solaris >= 7 */
+# if HAVE___FLBF /* Solaris >= 7, UnixWare 7.1.4 >= MP4 */
if (__flbf (fp))
return _IOLBF;
# else
diff --git a/lib/fpurge.c b/lib/fpurge.c
index f05da5abb..2af81a605 100644
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -19,7 +19,7 @@
/* Specification. */
#include <stdio.h>
-#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23 */
+#if HAVE_STDIO_EXT_H /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23 */
# include <stdio_ext.h>
#endif
#include <stdlib.h>
@@ -29,7 +29,7 @@
int
fpurge (FILE *fp)
{
-#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23, musl libc */
+#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23, musl libc, UnixWare 7.1.4 >= MP4 */
__fpurge (fp);
/* The __fpurge function does not have a return value. */
diff --git a/lib/freadable.h b/lib/freadable.h
index 5a17e4a03..c664b7d26 100644
--- a/lib/freadable.h
+++ b/lib/freadable.h
@@ -22,9 +22,11 @@
STREAM must not be wide-character oriented.
The result doesn't change until the stream is closed or re-opened. */
-#if HAVE___FREADABLE /* glibc >= 2.2, Solaris >= 7, Android API >= 23, musl libc */
+#if HAVE___FREADABLE /* glibc >= 2.2, Solaris >= 7, Android API >= 23, musl libc, UnixWare 7.1.4 >= MP4 */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define freadable(stream) (__freadable (stream) != 0)
#else
diff --git a/lib/freadahead.h b/lib/freadahead.h
index b971d5a06..d76b306ac 100644
--- a/lib/freadahead.h
+++ b/lib/freadahead.h
@@ -29,7 +29,9 @@
#if HAVE___FREADAHEAD /* musl libc */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define freadahead(stream) __freadahead (stream)
#else
diff --git a/lib/freading.h b/lib/freading.h
index 6c5592ec0..11deadc2d 100644
--- a/lib/freading.h
+++ b/lib/freading.h
@@ -33,9 +33,11 @@
STREAM must not be wide-character oriented. */
#if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
-/* Solaris >= 7, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc */
+/* Solaris >= 7, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc, UnixWare 7.1.4 >= MP4 */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define freading(stream) (__freading (stream) != 0)
#else
diff --git a/lib/freadptr.h b/lib/freadptr.h
index 07d2d727d..fc91a0b32 100644
--- a/lib/freadptr.h
+++ b/lib/freadptr.h
@@ -30,7 +30,9 @@
#if HAVE___FREADPTR /* musl libc */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define freadptr(stream,sizep) __freadptr (stream, sizep)
#else
diff --git a/lib/fseterr.h b/lib/fseterr.h
index bbeb6619f..81ca5b4d2 100644
--- a/lib/fseterr.h
+++ b/lib/fseterr.h
@@ -25,7 +25,9 @@
#if HAVE___FSETERR /* musl libc */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define fseterr(fp) __fseterr (fp)
#else
diff --git a/lib/fwritable.h b/lib/fwritable.h
index 44c760cf3..d8a705d34 100644
--- a/lib/fwritable.h
+++ b/lib/fwritable.h
@@ -22,9 +22,11 @@
STREAM must not be wide-character oriented.
The result doesn't change until the stream is closed or re-opened. */
-#if HAVE___FWRITABLE /* glibc >= 2.2, Solaris >= 7, Android API >= 23, musl libc */
+#if HAVE___FWRITABLE /* glibc >= 2.2, Solaris >= 7, Android API >= 23, musl libc, UnixWare 7.1.4 >= MP4 */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define fwritable(stream) (__fwritable (stream) != 0)
#else
diff --git a/lib/fwriting.h b/lib/fwriting.h
index 111e3dcb5..961e8a963 100644
--- a/lib/fwriting.h
+++ b/lib/fwriting.h
@@ -33,9 +33,11 @@
STREAM must not be wide-character oriented. */
-#if HAVE___FWRITING /* glibc >= 2.2, Solaris >= 7, Android API >= 29, musl libc */
+#if HAVE___FWRITING /* glibc >= 2.2, Solaris >= 7, Android API >= 29, musl libc, UnixWare 7.1.4 >= MP4 */
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
# define fwriting(stream) (__fwriting (stream) != 0)
#else
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: patch: stdio fiex for UnixWare
2020-09-24 20:49 patch: stdio fiex for UnixWare Tim Rice
@ 2020-09-24 23:08 ` Paul Eggert
2020-09-25 1:03 ` Tim Rice
2020-09-25 0:27 ` Bruno Haible
2020-10-11 13:31 ` patch: stdio fiex " Bruno Haible
2 siblings, 1 reply; 8+ messages in thread
From: Paul Eggert @ 2020-09-24 23:08 UTC (permalink / raw)
To: bug-gnulib; +Cc: Tim Rice
On 9/24/20 1:49 PM, Tim Rice wrote:
> Wrap "#include <stdio_ext.h>" in HAVE_STDIO_EXT_H insead of HAVE___X
Shouldn't this also add AC_CHECK_HEADERS_ONCE([stdio_ext.h]) to the
corresponding .m4 files, as fpending.m4 and getpass.m4 already do?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: patch: stdio fiex for UnixWare
2020-09-24 20:49 patch: stdio fiex for UnixWare Tim Rice
2020-09-24 23:08 ` Paul Eggert
@ 2020-09-25 0:27 ` Bruno Haible
2020-09-25 1:08 ` Tim Rice
2020-10-11 13:31 ` patch: stdio fiex " Bruno Haible
2 siblings, 1 reply; 8+ messages in thread
From: Bruno Haible @ 2020-09-25 0:27 UTC (permalink / raw)
To: bug-gnulib; +Cc: Tim Rice
Tim Rice wrote:
> I've attached a patch to address the fact that UnixWare does not have
> stdio_ext.h but has some __X() stdio helper functions.
In which header file are they declared? Can you show these declarations,
please?
Bruno
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: patch: stdio fiex for UnixWare
2020-09-24 23:08 ` Paul Eggert
@ 2020-09-25 1:03 ` Tim Rice
0 siblings, 0 replies; 8+ messages in thread
From: Tim Rice @ 2020-09-25 1:03 UTC (permalink / raw)
To: Paul Eggert; +Cc: bug-gnulib
[-- Attachment #1: Type: TEXT/PLAIN, Size: 409 bytes --]
Hi Paul,
On Thu, 24 Sep 2020, Paul Eggert wrote:
> On 9/24/20 1:49 PM, Tim Rice wrote:
> > Wrap "#include <stdio_ext.h>" in HAVE_STDIO_EXT_H insead of HAVE___X
>
> Shouldn't this also add AC_CHECK_HEADERS_ONCE([stdio_ext.h]) to the
> corresponding .m4 files, as fpending.m4 and getpass.m4 already do?
Seems reasonable.
I've attached stdio_ext_m4.patch
--
Tim Rice Multitalents
tim@multitalents.net
[-- Attachment #2: stdio_ext_m4.patch --]
[-- Type: TEXT/PLAIN, Size: 3545 bytes --]
ChangeLog
2020-09-24 Tim Rice <tim@multitalents.net>
* m4/fbufmode.m4: add AC_CHECK_HEADERS_ONCE([stdio_ext.h])
* m4/fpurge.m4: Likewise.
* m4/freadable.m4: Likewise.
* m4/freadahead.m4: Likewise.
* m4/freading.m4: Likewise.
* m4/freadptr.m4: Likewise.
* m4/fseterr.m4: Likewise.
* m4/fwritable.m4: Likewise.
* m4/fwriting.m4: Likewise.
diff --git a/m4/fbufmode.m4 b/m4/fbufmode.m4
index 87e76e0d7..99f835e5e 100644
--- a/m4/fbufmode.m4
+++ b/m4/fbufmode.m4
@@ -6,6 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FBUFMODE],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
dnl Prerequisites of lib/fbufmode.c.
AC_CHECK_FUNCS_ONCE([__flbf __fbufsize])
])
diff --git a/m4/fpurge.m4 b/m4/fpurge.m4
index 0796a6f0e..6bc3c937a 100644
--- a/m4/fpurge.m4
+++ b/m4/fpurge.m4
@@ -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>]])
diff --git a/m4/freadable.m4 b/m4/freadable.m4
index 3237effe0..e5a317ee8 100644
--- a/m4/freadable.m4
+++ b/m4/freadable.m4
@@ -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])
])
diff --git a/m4/freadahead.m4 b/m4/freadahead.m4
index 05132b526..5d2d9af87 100644
--- a/m4/freadahead.m4
+++ b/m4/freadahead.m4
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FREADAHEAD],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__freadahead])
])
diff --git a/m4/freading.m4 b/m4/freading.m4
index 440c241e4..10ad2349f 100644
--- a/m4/freading.m4
+++ b/m4/freading.m4
@@ -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])
])
diff --git a/m4/freadptr.m4 b/m4/freadptr.m4
index 799703554..88f4965e3 100644
--- a/m4/freadptr.m4
+++ b/m4/freadptr.m4
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FREADPTR],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__freadptr])
])
diff --git a/m4/fseterr.m4 b/m4/fseterr.m4
index 7266579b3..64036790f 100644
--- a/m4/fseterr.m4
+++ b/m4/fseterr.m4
@@ -6,5 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FSETERR],
[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
AC_CHECK_FUNCS_ONCE([__fseterr])
])
diff --git a/m4/fwritable.m4 b/m4/fwritable.m4
index dbe887e88..ac5d71eb4 100644
--- a/m4/fwritable.m4
+++ b/m4/fwritable.m4
@@ -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])
])
diff --git a/m4/fwriting.m4 b/m4/fwriting.m4
index 4d7cd3ede..a87f35986 100644
--- a/m4/fwriting.m4
+++ b/m4/fwriting.m4
@@ -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])
])
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: patch: stdio fiex for UnixWare
2020-09-25 0:27 ` Bruno Haible
@ 2020-09-25 1:08 ` Tim Rice
2020-09-25 4:18 ` patch: stdio fix " Tim Rice
0 siblings, 1 reply; 8+ messages in thread
From: Tim Rice @ 2020-09-25 1:08 UTC (permalink / raw)
To: Bruno Haible; +Cc: bug-gnulib
Hi Bruno,
On Fri, 25 Sep 2020, Bruno Haible wrote:
> Tim Rice wrote:
> > I've attached a patch to address the fact that UnixWare does not have
> > stdio_ext.h but has some __X() stdio helper functions.
>
> In which header file are they declared? Can you show these declarations,
> please?
>
> Bruno
stdio.h
extern size_t __fbufsiz(FILE *);
extern int __filbuf(FILE *);
extern int __flbf(FILE *);
extern int __flsbuf(int, FILE *);
extern size_t __fpending(FILE *);
extern void __fpurge(FILE *);
extern int __freadable(FILE *);
extern int __freading(FILE *);
extern int __fwritable(FILE *);
extern int __fwriting(FILE *);
extern void _flushlbf(void);
--
Tim Rice Multitalents
tim@multitalents.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: patch: stdio fix for UnixWare
2020-09-25 1:08 ` Tim Rice
@ 2020-09-25 4:18 ` Tim Rice
0 siblings, 0 replies; 8+ messages in thread
From: Tim Rice @ 2020-09-25 4:18 UTC (permalink / raw)
To: bug-gnulib; +Cc: Bruno Haible
On Thu, 24 Sep 2020, Tim Rice wrote:
>
> Hi Bruno,
>
> On Fri, 25 Sep 2020, Bruno Haible wrote:
>
> > Tim Rice wrote:
> > > I've attached a patch to address the fact that UnixWare does not have
> > > stdio_ext.h but has some __X() stdio helper functions.
> >
> > In which header file are they declared? Can you show these declarations,
> > please?
> >
> > Bruno
>
> stdio.h
>
> extern size_t __fbufsiz(FILE *);
> extern int __filbuf(FILE *);
> extern int __flbf(FILE *);
> extern int __flsbuf(int, FILE *);
> extern size_t __fpending(FILE *);
> extern void __fpurge(FILE *);
> extern int __freadable(FILE *);
> extern int __freading(FILE *);
> extern int __fwritable(FILE *);
> extern int __fwriting(FILE *);
> extern void _flushlbf(void);
This may be if interest also. (also stdio.h)
#define __flbf(p) ((void)sizeof(__filbuf(p)), ((FILE *)(p))->__flag & _IOLBF)
#define __freading(p) ((void)sizeof(__filbuf(p)), ((FILE *)(p))->__flag & _IOREAD)
#define __fwriting(p) ((void)sizeof(__filbuf(p)), ((FILE *)(p))->__flag & _IOWRT)
#define __freadable(p) (__freading(p) && __fpending(p))
#define __fwritable(p) (__fwriting(p) && __fpending(p) < __fbufsiz(p))
#define __fpurge(p) funflush(p)
--
Tim Rice Multitalents
tim@multitalents.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: patch: stdio fiex for UnixWare
2020-09-24 20:49 patch: stdio fiex for UnixWare Tim Rice
2020-09-24 23:08 ` Paul Eggert
2020-09-25 0:27 ` Bruno Haible
@ 2020-10-11 13:31 ` Bruno Haible
2020-10-11 17:46 ` Tim Rice
2 siblings, 1 reply; 8+ messages in thread
From: Bruno Haible @ 2020-10-11 13:31 UTC (permalink / raw)
To: bug-gnulib; +Cc: Tim Rice
Tim Rice wrote in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00127.html>:
>
> I've attached a patch to address the fact that UnixWare does not have
> stdio_ext.h but has some __X() stdio helper functions.
>
> Wrap "#include <stdio_ext.h>" in HAVE_STDIO_EXT_H insead of HAVE___X
I'm applying the patch below, to fix this. The main differences to yours are:
* No need to touch the modules freadahead, freadptr, fseterr, since the
functions __freadahead, __freadptr, __fseterr don't exist on your platform,
as you reported in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00133.html>.
* When we modify a .m4 file, we also need to bump its serial number.
* It does not make the code clearer to remove the HAVE___FLBF and HAVE___FPURGE
tests in fbufmode.c and fpurge.c.
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.
diff --git a/lib/fbufmode.c b/lib/fbufmode.c
index 65a5cfc..a528a63 100644
--- a/lib/fbufmode.c
+++ b/lib/fbufmode.c
@@ -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"
diff --git a/lib/fpurge.c b/lib/fpurge.c
index fc88646..9469ce4 100644
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -19,8 +19,10 @@
/* 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>
diff --git a/lib/freadable.h b/lib/freadable.h
index f05e5fb..9139865 100644
--- a/lib/freadable.h
+++ b/lib/freadable.h
@@ -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
diff --git a/lib/freading.h b/lib/freading.h
index 1891f5a..7bef18e 100644
--- a/lib/freading.h
+++ b/lib/freading.h
@@ -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
diff --git a/lib/fwritable.h b/lib/fwritable.h
index 509e069..fb9c871 100644
--- a/lib/fwritable.h
+++ b/lib/fwritable.h
@@ -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
diff --git a/lib/fwriting.h b/lib/fwriting.h
index 2d16f42..3aa5d7f 100644
--- a/lib/fwriting.h
+++ b/lib/fwriting.h
@@ -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
diff --git a/m4/fbufmode.m4 b/m4/fbufmode.m4
index 87e76e0..e2a146f 100644
--- a/m4/fbufmode.m4
+++ b/m4/fbufmode.m4
@@ -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])
])
diff --git a/m4/fpurge.m4 b/m4/fpurge.m4
index 0796a6f..9a486e0 100644
--- a/m4/fpurge.m4
+++ b/m4/fpurge.m4
@@ -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>]])
diff --git a/m4/freadable.m4 b/m4/freadable.m4
index 3237eff..e988054 100644
--- a/m4/freadable.m4
+++ b/m4/freadable.m4
@@ -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])
])
diff --git a/m4/freading.m4 b/m4/freading.m4
index 440c241..6eb25ab 100644
--- a/m4/freading.m4
+++ b/m4/freading.m4
@@ -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])
])
diff --git a/m4/fwritable.m4 b/m4/fwritable.m4
index dbe887e..55db08f 100644
--- a/m4/fwritable.m4
+++ b/m4/fwritable.m4
@@ -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])
])
diff --git a/m4/fwriting.m4 b/m4/fwriting.m4
index 4d7cd3e..fe2f10e 100644
--- a/m4/fwriting.m4
+++ b/m4/fwriting.m4
@@ -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])
])
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: patch: stdio fiex for UnixWare
2020-10-11 13:31 ` patch: stdio fiex " Bruno Haible
@ 2020-10-11 17:46 ` Tim Rice
0 siblings, 0 replies; 8+ messages in thread
From: Tim Rice @ 2020-10-11 17:46 UTC (permalink / raw)
To: Bruno Haible; +Cc: bug-gnulib
Hi Bruno,
On Sun, 11 Oct 2020, Bruno Haible wrote:
> I'm applying the patch below, to fix this. The main differences to yours are:
> * No need to touch the modules freadahead, freadptr, fseterr, since the
> functions __freadahead, __freadptr, __fseterr don't exist on your platform,
True as things stand today. I figured it would be more future proof
so add those now in case __freadahead, __freadptr, __fseterr are added
to UnixWare later.
> <https://lists.gnu.org/archive/html/bug-gnulib/2020-09/msg00133.html>.
> * When we modify a .m4 file, we also need to bump its serial number.
Sorry, I've seen enough patches come by on this list, I should have
remembered that.
> * It does not make the code clearer to remove the HAVE___FLBF and HAVE___FPURGE
> tests in fbufmode.c and fpurge.c.
Fine with me.
Thank you for the commit.
--
Tim Rice Multitalents (707) 456-1146
tim@multitalents.net
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-10-11 17:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24 20:49 patch: stdio fiex for UnixWare Tim Rice
2020-09-24 23:08 ` Paul Eggert
2020-09-25 1:03 ` Tim Rice
2020-09-25 0:27 ` Bruno Haible
2020-09-25 1:08 ` Tim Rice
2020-09-25 4:18 ` patch: stdio fix " Tim Rice
2020-10-11 13:31 ` patch: stdio fiex " Bruno Haible
2020-10-11 17:46 ` Tim Rice
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).