Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include Fix visibility of various C99 features, esp. for C++11.



details:   https://anonhg.NetBSD.org/src/rev/8803191918f8
branches:  trunk
changeset: 849938:8803191918f8
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Mar 20 01:08:42 2020 +0000

description:
Fix visibility of various C99 features, esp. for C++11.

diffstat:

 include/ctype.h |   9 ++++++---
 include/stdio.h |  25 +++++++++++++++----------
 include/wchar.h |  12 ++++++------
 3 files changed, 27 insertions(+), 19 deletions(-)

diffs (131 lines):

diff -r d5918544cc2f -r 8803191918f8 include/ctype.h
--- a/include/ctype.h   Fri Mar 20 01:06:11 2020 +0000
+++ b/include/ctype.h   Fri Mar 20 01:08:42 2020 +0000
@@ -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    _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
diff -r d5918544cc2f -r 8803191918f8 include/stdio.h
--- a/include/stdio.h   Fri Mar 20 01:06:11 2020 +0000
+++ b/include/stdio.h   Fri Mar 20 01:08:42 2020 +0000
@@ -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 @@
 /*
  * 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    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 @@
 /*
  * 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 @@
  * 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 @@
     __va_list)
     __scanflike(2, 0);
 __END_DECLS
-#endif /* _ISOC99_SOURCE || _NETBSD_SOURCE */
+#endif /* C99 */
 
 /*
  * Routines that are purely local.
diff -r d5918544cc2f -r 8803191918f8 include/wchar.h
--- a/include/wchar.h   Fri Mar 20 01:06:11 2020 +0000
+++ b/include/wchar.h   Fri Mar 20 01:08:42 2020 +0000
@@ -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 @@
        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 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);



Home | Main Index | Thread Index | Old Index