[PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++
Florian Weimer
fweimer@redhat.com
Mon Oct 9 13:24:00 GMT 2017
On 09/22/2017 08:16 PM, Jonathan Wakely wrote:
> +#ifdef __cplusplus
> +/* This is to enable compatibility for ISO C++17. */
> +#if __cplusplus >= 201703L
> +# define __USE_ISOC11 1
> +#endif
> /* This is to enable compatibility for ISO C++11.
The inner #if/#endif should be indented (similar to the inner #define).
> -
> - 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
I think there is a preexisting issue here which will trigger macro
redefinition warnings with -Wsystem-headers. But perhaps I'm mistaken.
Apart from that, the substance of the patch looks okay to me.
Thanks,
Florian
More information about the Libc-alpha
mailing list