]> sourceware.org Git - newlib-cygwin.git/commitdiff
stdio.h: guard function macros with !__cplusplus
authorYaakov Selkowitz <yselkowi@redhat.com>
Tue, 13 Jun 2017 19:51:18 +0000 (14:51 -0500)
committerYaakov Selkowitz <yselkowi@redhat.com>
Wed, 14 Jun 2017 15:18:14 +0000 (10:18 -0500)
While POSIX allows these functions to also be defined as macros in C, in
C++ this is not allowed, and prevents these names (particularly feof) from
being used in a custom namespace.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
newlib/libc/include/stdio.h

index 097b0f6659e0aa7bf7b39054c1d687ec5bd31c9b..1c32423d3b1fe9f47ca87838597983e64228b404 100644 (file)
@@ -718,6 +718,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
 #define        __sclearerr(p)  ((void)((p)->_flags &= ~(__SERR|__SEOF)))
 #define        __sfileno(p)    ((p)->_file)
 
+#ifndef __cplusplus
 #ifndef _REENT_SMALL
 #define        feof(p)         __sfeof(p)
 #define        ferror(p)       __sferror(p)
@@ -740,6 +741,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
 #define putc(x, fp)    __sputc_r(_REENT, x, fp)
 #endif /* lint */
 #endif /* __CYGWIN__ */
+#endif /* __cplusplus */
 
 #if __MISC_VISIBLE
 /* fast always-buffered version, true iff error */
This page took 0.031211 seconds and 5 git commands to generate.