[PATCH] float128: Extend __MATH_TG for float128 support

Joseph Myers joseph@codesourcery.com
Mon May 15 21:49:00 GMT 2017


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



More information about the Libc-alpha mailing list