diff --git a/flang/runtime/complex-reduction.h b/flang/runtime/complex-reduction.h --- a/flang/runtime/complex-reduction.h +++ b/flang/runtime/complex-reduction.h @@ -20,7 +20,7 @@ struct CppDescriptor; /* dummy type name for Fortran::runtime::Descriptor */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && !(defined(__clang_major__) && __clang_major__ >= 12) typedef _Fcomplex float_Complex_t; typedef _Dcomplex double_Complex_t; typedef _Lcomplex long_double_Complex_t; diff --git a/flang/runtime/complex-reduction.c b/flang/runtime/complex-reduction.c --- a/flang/runtime/complex-reduction.c +++ b/flang/runtime/complex-reduction.c @@ -23,7 +23,7 @@ /* Not all environments define CMPLXF, CMPLX, CMPLXL. */ #ifndef CMPLXF -#if __clang_major__ >= 12 +#if defined(__clang_major__) && (__clang_major__ >= 12) #define CMPLXF __builtin_complex #else static float_Complex_t CMPLXF(float r, float i) { @@ -39,7 +39,7 @@ #endif #ifndef CMPLX -#if __clang_major__ >= 12 +#if defined(__clang_major__) && (__clang_major__ >= 12) #define CMPLX __builtin_complex #else static double_Complex_t CMPLX(double r, double i) { @@ -55,7 +55,7 @@ #endif #ifndef CMPLXL -#if __clang_major__ >= 12 +#if defined(__clang_major__) && (__clang_major__ >= 12) #define CMPLXL __builtin_complex #else static long_double_Complex_t CMPLXL(long double r, long double i) {