Skip to content

Commit d9c8550

Browse files
authored
[flang] Fixed build issues after f20ea05. (#84377)
Older versions of clang do not have __builtin_complex, but they may define `__GNUC__`.
1 parent 3846019 commit d9c8550

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/runtime/complex-reduction.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ static long_double_Complex_t CMPLXL(long double r, long double i) {
8282
* supports __builtin_complex. For Clang, require >=12.0.
8383
* Otherwise, rely on the memory layout compatibility.
8484
*/
85-
#if (defined(__clang_major__) && (__clang_major__ >= 12)) || defined(__GNUC__)
85+
#if (defined(__clang_major__) && (__clang_major__ >= 12)) || \
86+
(defined(__GNUC__) && !defined(__clang__))
8687
#define CMPLXF128 __builtin_complex
8788
#else
8889
static CFloat128ComplexType CMPLXF128(CFloat128Type r, CFloat128Type i) {

0 commit comments

Comments
 (0)