sys/cdefs.h: visibility for old C++ standards

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

sys/cdefs.h: visibility for old C++ standards

Jeremie Courreges-Anglas-2

IIUC we should limit the visibility of C features to ANSI C (instead of
C11) for old C++ standards.

I guess this is low priority so I didn't do much testing, but I can do
a base+xenocara build on amd64 and sparc64 if deemed useful.

Thoughts?


Index: cdefs.h
===================================================================
RCS file: /d/cvs/src/sys/sys/cdefs.h,v
retrieving revision 1.43
diff -u -p -p -u -r1.43 cdefs.h
--- cdefs.h 29 Oct 2018 17:10:40 -0000 1.43
+++ cdefs.h 30 Jan 2020 19:05:23 -0000
@@ -382,6 +382,9 @@
     (defined(__cplusplus) && __cplusplus >= 201103)
 # undef __ISO_C_VISIBLE
 # define __ISO_C_VISIBLE 1999
+#elif (defined(__cplusplus) && __cplusplus < 201103)
+#undef __ISO_C_VISIBLE
+#define __ISO_C_VISIBLE 1990
 #endif
 
 /*

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE