From fd76df5d12d6710fc94a78b91cc554b64f077c70 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 11 Oct 2020 14:43:20 +0200 Subject: [PATCH] stdioext: Update comments regarding Cygwin. * lib/fpending.c: Update comments. * lib/fpurge.c: Likewise. * lib/freadable.h: Likewise. * lib/freadable.c: Likewise. * lib/freading.h: Likewise. * lib/freading.c: Likewise. * lib/fwritable.h: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.h: Likewise. * lib/fwriting.c: Likewise. --- ChangeLog | 14 ++++++++++++++ lib/fpending.c | 4 ++-- lib/fpurge.c | 6 +++--- lib/freadable.c | 5 +++-- lib/freadable.h | 2 +- lib/freading.c | 2 +- lib/freading.h | 2 +- lib/fwritable.c | 5 +++-- lib/fwritable.h | 2 +- lib/fwriting.c | 7 ++++--- lib/fwriting.h | 2 +- 11 files changed, 34 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5789d74055..defa84ad2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2020-10-11 Bruno Haible + + stdioext: Update comments regarding Cygwin. + * lib/fpending.c: Update comments. + * lib/fpurge.c: Likewise. + * lib/freadable.h: Likewise. + * lib/freadable.c: Likewise. + * lib/freading.h: Likewise. + * lib/freading.c: Likewise. + * lib/fwritable.h: Likewise. + * lib/fwritable.c: Likewise. + * lib/fwriting.h: Likewise. + * lib/fwriting.c: Likewise. + 2020-10-11 KO Myung-Hun Fix "warning: implicit declaration of function 'pthread_sigmask'". diff --git a/lib/fpending.c b/lib/fpending.c index 802ebcba65..4cc0ea747a 100644 --- a/lib/fpending.c +++ b/lib/fpending.c @@ -25,7 +25,7 @@ #include "stdio-impl.h" /* This file is not used on systems that already have the __fpending function, - namely glibc >= 2.2, Solaris >= 7, Android API >= 23. */ + namely glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 23. */ /* Return the number of pending (aka buffered, unflushed) bytes on the stream, FP, that is open for writing. */ @@ -39,7 +39,7 @@ __fpending (FILE *fp) /* GNU libc, BeOS, Haiku, Linux libc5 */ return fp->_IO_write_ptr - fp->_IO_write_base; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ return fp->_p - fp->_bf._base; #elif defined __EMX__ /* emx+gcc */ return fp->_ptr - fp->_buffer; diff --git a/lib/fpurge.c b/lib/fpurge.c index f05da5abba..fc88646ca4 100644 --- a/lib/fpurge.c +++ b/lib/fpurge.c @@ -19,7 +19,7 @@ /* Specification. */ #include -#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23 */ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Cygwin >= 1.7.10, Android API >= 23 */ # include #endif #include @@ -29,13 +29,13 @@ 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, Cygwin >= 1.7.10, Android API >= 23, musl libc */ __fpurge (fp); /* The __fpurge function does not have a return value. */ return 0; -#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */ +#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin >= 1.7 */ /* Call the system's fpurge function. */ # undef fpurge diff --git a/lib/freadable.c b/lib/freadable.c index 160fc3074c..b7110cbc03 100644 --- a/lib/freadable.c +++ b/lib/freadable.c @@ -26,7 +26,8 @@ #endif /* This file is not used on systems that have the __freadable function, - namely glibc >= 2.2, Solaris >= 7, Android API >= 23, musl libc. */ + namely glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 23, + musl libc. */ bool freadable (FILE *fp) @@ -38,7 +39,7 @@ freadable (FILE *fp) /* GNU libc, BeOS, Haiku, Linux libc5 */ return (fp->_flags & _IO_NO_READS) == 0; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ return (fp_->_flags & (__SRW | __SRD)) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & (_IORW | _IOREAD)) != 0; diff --git a/lib/freadable.h b/lib/freadable.h index 5a17e4a03a..f05e5fb397 100644 --- a/lib/freadable.h +++ b/lib/freadable.h @@ -22,7 +22,7 @@ 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, Cygwin >= 1.7.34, Android API >= 23, musl libc */ # include # define freadable(stream) (__freadable (stream) != 0) diff --git a/lib/freading.c b/lib/freading.c index f4dab78e30..f0466761e6 100644 --- a/lib/freading.c +++ b/lib/freading.c @@ -37,7 +37,7 @@ freading (FILE *fp) || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 && fp->_IO_read_base != NULL)); # elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ return (fp_->_flags & __SRD) != 0; # elif defined __EMX__ /* emx+gcc */ return (fp->_flags & _IOREAD) != 0; diff --git a/lib/freading.h b/lib/freading.h index 6c5592ec0c..1891f5af4f 100644 --- a/lib/freading.h +++ b/lib/freading.h @@ -33,7 +33,7 @@ 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, Cygwin >= 1.7.34, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc */ # include # define freading(stream) (__freading (stream) != 0) diff --git a/lib/fwritable.c b/lib/fwritable.c index fa6231da3b..51407d743e 100644 --- a/lib/fwritable.c +++ b/lib/fwritable.c @@ -26,7 +26,8 @@ #endif /* This file is not used on systems that have the __fwritable function, - namely glibc >= 2.2, Solaris >= 7, Android API >= 23, musl libc. */ + namely glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 23, + musl libc. */ bool fwritable (FILE *fp) @@ -38,7 +39,7 @@ fwritable (FILE *fp) /* GNU libc, BeOS, Haiku, Linux libc5 */ return (fp->_flags & _IO_NO_WRITES) == 0; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ return (fp_->_flags & (__SRW | __SWR)) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & (_IORW | _IOWRT)) != 0; diff --git a/lib/fwritable.h b/lib/fwritable.h index 44c760cf3b..509e069528 100644 --- a/lib/fwritable.h +++ b/lib/fwritable.h @@ -22,7 +22,7 @@ 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, Cygwin >= 1.7.34, Android API >= 23, musl libc */ # include # define fwritable(stream) (__fwritable (stream) != 0) diff --git a/lib/fwriting.c b/lib/fwriting.c index e0d535df3a..466d277d09 100644 --- a/lib/fwriting.c +++ b/lib/fwriting.c @@ -21,8 +21,9 @@ #include "stdio-impl.h" -/* This file is not used on systems that have the __fwritable function, - namely glibc >= 2.2, Solaris >= 7, Android API >= 29, musl libc. */ +/* This file is not used on systems that have the __fwriting function, + namely glibc >= 2.2, Solaris >= 7, Cygwin >= 1.7.34, Android API >= 29, + musl libc. */ bool fwriting (FILE *fp) @@ -34,7 +35,7 @@ fwriting (FILE *fp) /* GNU libc, BeOS, Haiku, Linux libc5 */ return (fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) != 0; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ return (fp_->_flags & __SWR) != 0; #elif defined __EMX__ /* emx+gcc */ return (fp->_flags & _IOWRT) != 0; diff --git a/lib/fwriting.h b/lib/fwriting.h index 111e3dcb56..2d16f42d47 100644 --- a/lib/fwriting.h +++ b/lib/fwriting.h @@ -33,7 +33,7 @@ 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, Cygwin >= 1.7.34, Android API >= 29, musl libc */ # include # define fwriting(stream) (__fwriting (stream) != 0) -- 2.39.5