This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++


On 22/09/17 17:59 +0000, Joseph Myers wrote:
On Fri, 22 Sep 2017, Jonathan Wakely wrote:

+#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

There is a comment listing all the __USE_ macros at the top of features.h.
It should be updated to add __USE_ISOCXX17.  (Actually, it needs
__USE_ISOCXX11 added as well, but that's a preexisting condition.  And I'm
not sure __USE_ISOCXX17 should be added at all until there is something to
condition on it.)

Good point. If there was reason to add it without anything using it
then there should be a __USE_ISOCXX14 as well. But since nothing needs
them, they can be left out.

The existing __USE_* macros are also undefined in features.h before being
possibly defined, including __USE_ISOCXX11.  If a new __USE_ISOCXX17 is
added, it should be added to that #undef sequence as well.

Here's a new patch without __USE_ISOCXX17 and listing __USE_ISOCXX11
in the comment at the top.

Tested x86_64-linux.

Attachment: 0001-BZ-21326-Ensure-C99-and-C11-interfaces-are-available.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]