@@ -811,6 +811,13 @@ float _Complex test(float _Complex z) { return z; }
811
811
'''
812
812
have_complex = cc.compiles(complex_code, name : ' supports _Complex' , args : core_c_args)
813
813
814
+ builtin_complex_code = '''
815
+ #include <stddef.h>
816
+ double _Complex test(double r, double i) { return __builtin_complex(r, i); }
817
+ '''
818
+
819
+ have_builtin_complex = have_complex and cc.compiles(builtin_complex_code, name : ' supports __builtin_complex' , args : core_c_args)
820
+
814
821
# CompCert does not have __builtin_expect
815
822
builtin_expect_code = '''
816
823
volatile int a = 42;
@@ -1050,6 +1057,7 @@ conf_data.set('_HAVE_BITFIELDS_IN_PACKED_STRUCTS', have_bitfields_in_packed_stru
1050
1057
conf_data.set(' _HAVE_BUILTIN_MUL_OVERFLOW' , have_builtin_mul_overflow, description : ' Compiler has __builtin_mul_overflow' )
1051
1058
conf_data.set(' _HAVE_BUILTIN_ADD_OVERFLOW' , have_builtin_add_overflow, description : ' Compiler has __builtin_add_overflow' )
1052
1059
conf_data.set(' _HAVE_COMPLEX' , have_complex, description : ' Compiler supports _Complex' )
1060
+ conf_data.set(' _HAVE_BUILTIN_COMPLEX' , have_builtin_complex, description : ' Compiler has __builtin_complex' )
1053
1061
conf_data.set(' _HAVE_BUILTIN_EXPECT' , have_builtin_expect, description : ' Compiler has __builtin_expect' )
1054
1062
conf_data.set(' _HAVE_ALLOC_SIZE' , have_alloc_size, description : ' The compiler REALLY has the attribute __alloc_size__' )
1055
1063
conf_data.set(' _HAVE_ATTRIBUTE_ALWAYS_INLINE' ,
0 commit comments