This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 22 Sep 2017 17:59:17 +0000
- Subject: Re: [PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++
- Authentication-results: sourceware.org; auth=none
- References: <20170922175120.GA21566@redhat.com>
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.)
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.
--
Joseph S. Myers
joseph@codesourcery.com