mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Don't expose __generic() when not using C++.
According to the GCC documentation, the constructs used to implement <tgmath.h> are only available in C mode. They only cause breakage when used used with g++. Reported by: tijl
This commit is contained in:
parent
1f32d3b76f
commit
9b6e65b66f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230277
@ -260,7 +260,7 @@
|
|||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
#define __generic(expr, t, yes, no) \
|
#define __generic(expr, t, yes, no) \
|
||||||
_Generic(expr, t: yes, default: no)
|
_Generic(expr, t: yes, default: no)
|
||||||
#elif __GNUC_PREREQ__(3, 1)
|
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
|
||||||
#define __generic(expr, t, yes, no) \
|
#define __generic(expr, t, yes, no) \
|
||||||
__builtin_choose_expr( \
|
__builtin_choose_expr( \
|
||||||
__builtin_types_compatible_p(__typeof(expr), t), yes, no)
|
__builtin_types_compatible_p(__typeof(expr), t), yes, no)
|
||||||
|
Loading…
Reference in New Issue
Block a user