This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/21326] C99 functions are not declared for C++11 and later if _GNU_SOURCE is not predefined by g++
- From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 30 Mar 2017 10:55:19 +0000
- Subject: [Bug libc/21326] C99 functions are not declared for C++11 and later if _GNU_SOURCE is not predefined by g++
- Auto-submitted: auto-generated
- References: <bug-21326-131@http.sourceware.org/bugzilla/>
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.