Module Name: src
Committed By: joerg
Date: Fri Mar 20 01:08:43 UTC 2020
Modified Files:
src/include: ctype.h stdio.h wchar.h
Log Message:
Fix visibility of various C99 features, esp. for C++11.
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/include/ctype.h
cvs rdiff -u -r1.98 -r1.99 src/include/stdio.h
cvs rdiff -u -r1.43 -r1.44 src/include/wchar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/include/ctype.h
diff -u src/include/ctype.h:1.34 src/include/ctype.h:1.35
--- src/include/ctype.h:1.34 Sun Apr 28 19:39:56 2013
+++ src/include/ctype.h Fri Mar 20 01:08:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ctype.h,v 1.34 2013/04/28 19:39:56 joerg Exp $ */
+/* $NetBSD: ctype.h,v 1.35 2020/03/20 01:08:42 joerg Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -86,8 +86,11 @@ int _tolower(int);
int _toupper(int);
#endif
-#if defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) > 200112L || \
- (_XOPEN_SOURCE - 0) > 600 || defined(_NETBSD_SOURCE)
+#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+ !defined(_XOPEN_SOURCE)) || ((_POSIX_C_SOURCE - 0) >= 200112L || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+ (__cplusplus - 0) >= 201103L || (_XOPEN_SOURCE - 0) > 600 || \
+ defined(_NETBSD_SOURCE))
int isblank(int);
#endif
__END_DECLS
Index: src/include/stdio.h
diff -u src/include/stdio.h:1.98 src/include/stdio.h:1.99
--- src/include/stdio.h:1.98 Fri Dec 13 20:25:16 2019
+++ src/include/stdio.h Fri Mar 20 01:08:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: stdio.h,v 1.98 2019/12/13 20:25:16 mrg Exp $ */
+/* $NetBSD: stdio.h,v 1.99 2020/03/20 01:08:42 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -41,6 +41,13 @@
#include <sys/featuretest.h>
#include <sys/ansi.h>
+#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+ !defined(_XOPEN_SOURCE)) || ((_POSIX_C_SOURCE - 0) >= 200809L || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+ (__cplusplus - 0) >= 201103L || defined(_NETBSD_SOURCE))
+#define __STDIO_C99_FEATURES
+#endif
+
#ifdef _BSD_SIZE_T_
typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
@@ -307,8 +314,8 @@ __END_DECLS
/*
* IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2
*/
-#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
- defined(_REENTRANT) || defined(_NETBSD_SOURCE)
+#if defined(__STDIO_C99_FEATURES) || (_POSIX_C_SOURCE - 0) >= 199506L || \
+ (_XOPEN_SOURCE - 0) >= 500 || defined(_REENTRANT)
__BEGIN_DECLS
void flockfile(FILE *);
int ftrylockfile(FILE *);
@@ -318,7 +325,7 @@ int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
__END_DECLS
-#endif /* _POSIX_C_SOURCE >= 1995056 || _XOPEN_SOURCE >= 500 || ... */
+#endif /* C99 || _POSIX_C_SOURCE >= 1995056 || _XOPEN_SOURCE >= 500 || ... */
/*
* Functions defined in POSIX 1003.2 and XPG2 or later.
@@ -339,11 +346,9 @@ __END_DECLS
/*
* Functions defined in ISO XPG4.2, ISO C99, POSIX 1003.1-2001 or later.
*/
-#if ((__STDC_VERSION__ - 0) >= 199901L) || \
- ((_POSIX_C_SOURCE - 0) >= 200112L) || \
+#if defined(__STDIO_C99_FEATURES) || (_POSIX_C_SOURCE - 0) >= 200112L || \
(defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
- ((_XOPEN_SOURCE - 0) >= 500) || \
- defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+ (_XOPEN_SOURCE - 0) >= 500
__BEGIN_DECLS
int snprintf(char * __restrict, size_t, const char * __restrict, ...)
__printflike(3, 4);
@@ -387,7 +392,7 @@ __END_DECLS
* Functions defined in ISO C99. Still put under _NETBSD_SOURCE due to
* backward compatible.
*/
-#if defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(__STDIO_C99_FEATURES)
__BEGIN_DECLS
int vscanf(const char * __restrict, __va_list)
__scanflike(1, 0);
@@ -397,7 +402,7 @@ int vsscanf(const char * __restrict, co
__va_list)
__scanflike(2, 0);
__END_DECLS
-#endif /* _ISOC99_SOURCE || _NETBSD_SOURCE */
+#endif /* C99 */
/*
* Routines that are purely local.
Index: src/include/wchar.h
diff -u src/include/wchar.h:1.43 src/include/wchar.h:1.44
--- src/include/wchar.h:1.43 Fri Dec 28 13:11:46 2018
+++ src/include/wchar.h Fri Mar 20 01:08:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: wchar.h,v 1.43 2018/12/28 13:11:46 maya Exp $ */
+/* $NetBSD: wchar.h,v 1.44 2020/03/20 01:08:42 joerg Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -151,9 +151,9 @@ long int wcstol(const wchar_t * __restri
wchar_t ** __restrict, int);
double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
-#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) > 199901L || \
- defined(_NETBSD_SOURCE) || \
- (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
+#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+ (__cplusplus - 0) >= 201103L || defined(_NETBSD_SOURCE) || \
+ (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
long double wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
@@ -194,8 +194,8 @@ int vwprintf(const wchar_t * __restrict,
int wprintf(const wchar_t * __restrict, ...);
int wscanf(const wchar_t * __restrict, ...);
#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) > 199901L || \
- defined(_NETBSD_SOURCE) || \
- (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
+ (__cplusplus - 0) >= 201103L || defined(_NETBSD_SOURCE) || \
+ (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
int vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list);
int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
__va_list);