diff options
author | theraven <theraven@FreeBSD.org> | 2013-07-29 12:33:03 +0000 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2013-07-29 12:33:03 +0000 |
commit | 613035d60b4ef16fb4775edffe2853bd3b5cbb07 (patch) | |
tree | f230d5d450c594944be3bc312b4e9d5559cef44d /lib/msun | |
parent | b37d7ced753f313ff16dba2fd5b4811aaa6647a7 (diff) | |
download | FreeBSD-src-613035d60b4ef16fb4775edffe2853bd3b5cbb07.zip FreeBSD-src-613035d60b4ef16fb4775edffe2853bd3b5cbb07.tar.gz |
Restore the longer form of the _Generic. The short form does not work in C++.
Diffstat (limited to 'lib/msun')
-rw-r--r-- | lib/msun/src/math.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index bda278a..1bd931c 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -83,10 +83,19 @@ extern const union __nan_un { #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ __has_extension(c_generic_selections) -#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ +#define __fp_type_select(x, f, d, ld) _Generic((x), \ float: f(x), \ double: d(x), \ - long double: ld(x)) + long double: ld(x), \ + volatile float: f(x), \ + volatile double: d(x), \ + volatile long double: ld(x), \ + volatile const float: f(x), \ + volatile const double: d(x), \ + volatile const long double: ld(x), \ + const float: f(x), \ + const double: d(x), \ + const long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ |