[Bug libc/21326] C99 functions are not declared for C++11 and later if _GNU_SOURCE is not predefined by g++
jwakely.gcc at gmail dot com
sourceware-bugzilla@sourceware.org
Thu Mar 30 10:55:00 GMT 2017
https://sourceware.org/bugzilla/show_bug.cgi?id=21326
--- Comment #4 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
--- a/include/features.h
+++ b/include/features.h
@@ -236,13 +236,18 @@
# define __USE_ISOC95 1
#endif
+#ifdef __cplusplus
+/* This is to enable compatibility for ISO C++17. */
+#if (__cplusplus >= 201703L)
+# define __USE_ISOCXX17 1
+# define __USE_ISOC11 1
+#endif
/* This is to enable compatibility for ISO C++11.
-
- So far g++ does not provide a macro. Check the temporary macro for
- now, too. */
-#if ((defined __cplusplus && __cplusplus >= 201103L) \
- || defined __GXX_EXPERIMENTAL_CXX0X__)
+ Check the temporary macro for now, too. */
+#if (__cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__)
# define __USE_ISOCXX11 1
+# define __USE_ISOC99 1
+#endif
#endif
/* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list