summaryrefslogtreecommitdiff
path: root/include/stdio.h
diff options
context:
space:
mode:
authorkleink <kleink@NetBSD.org>1998-11-20 14:39:38 +0000
committerkleink <kleink@NetBSD.org>1998-11-20 14:39:38 +0000
commit048353ddfd01962e0935306c4ebb79958aeec62d (patch)
tree39d7b8ca32e7b0265d4cd63df0fda1df8049f624 /include/stdio.h
parentc9971df57344357e08e38804f0aa7bb3e4b098c8 (diff)
* Bring *_unlocked() declarations in scope if _REENTRANT is defined, too; add
similar protection for the definitions of the macro versions. * Don't define a macro version of fileno() in a _REENTRANT environment.
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 2b2c74eac25..eee3f76ce35 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stdio.h,v 1.29 1998/09/28 17:47:58 kleink Exp $ */
+/* $NetBSD: stdio.h,v 1.30 1998/11/20 14:39:38 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -287,7 +287,7 @@ __END_DECLS
*/
#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
!defined(_XOPEN_SOURCE)) || (_POSIX_C_SOURCE - 0) >= 199506L || \
- (_XOPEN_SOURCE - 0) >= 500
+ (_XOPEN_SOURCE - 0) >= 500 || defined(_REENTRANT)
__BEGIN_DECLS
#if 0 /* not yet */
void flockfile __P((FILE *));
@@ -421,20 +421,26 @@ static __inline int __sputc(int _c, FILE *_p) {
#define getc(fp) __sgetc(fp)
#define putc(x, fp) __sputc(x, fp)
-#endif /* _REENTRANT */
+#endif /* !_REENTRANT */
#endif /* lint */
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
#ifndef _ANSI_SOURCE
+#ifndef _REENTRANT
#define fileno(p) __sfileno(p)
+#endif /* !_REENTRANT */
+#endif /* !_ANSI_SOURCE */
+#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+ !defined(_XOPEN_SOURCE)) || (_POSIX_C_SOURCE - 0) >= 199506L || \
+ (_XOPEN_SOURCE - 0) >= 500 || defined(_REENTRANT)
#define getc_unlocked(fp) __sgetc(fp)
#define putc_unlocked(x, fp) __sputc(x, fp)
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
-#endif /* _ANSI_SOURCE */
+#endif /* (!_ANSI_SOURCE && !_POSIX_C_SOURCE && !_XOPEN_SOURCE) || ... */
#endif /* _STDIO_H_ */