This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] float128: Extend __MATH_TG for float128 support
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 15 May 2017 21:49:05 +0000
- Subject: Re: [PATCH] float128: Extend __MATH_TG for float128 support
- Authentication-results: sourceware.org; auth=none
- References: <1494882265-18912-1-git-send-email-gftg@linux.vnet.ibm.com>
On Mon, 15 May 2017, Gabriel F. T. Gomes wrote:
> +#elif __HAVE_DISTINCT_FLOAT128
> +# if __USE_ISOC11
> +# define __MATH_TG(TG_ARG, FUNC, ARGS) \
> + _Generic ((TG_ARG), \
> + float: FUNC ## f ARGS, \
> + default: FUNC ARGS, \
> + long double: FUNC ## l ARGS, \
> + _Float128: FUNC ## f128 ARGS)
__USE_ISOC11 is about whether to declare library functions etc. from C11;
it's nothing to do with whether there's compiler support for C11.
Something like
__GNUC_PREREQ (4, 9) || (!defined __GNUC__ && defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)
would be more appropriate (or use that to define a macro in sys/cdefs.h
for whether _Generic is available).
--
Joseph S. Myers
joseph@codesourcery.com