[flang-commits] [PATCH] D110139: [flang] Change complex type define in runtime for clang-cl
Diana Picus via Phabricator via flang-commits
flang-commits at lists.llvm.org
Tue Sep 21 05:27:19 PDT 2021
rovka updated this revision to Diff 373874.
rovka added a comment.
Thanks for the review, I've updated all relevant sites to check if __clang_major__ is defined.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110139/new/
https://reviews.llvm.org/D110139
Files:
flang/runtime/complex-reduction.c
flang/runtime/complex-reduction.h
Index: flang/runtime/complex-reduction.h
===================================================================
--- flang/runtime/complex-reduction.h
+++ 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;
Index: flang/runtime/complex-reduction.c
===================================================================
--- flang/runtime/complex-reduction.c
+++ 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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110139.373874.patch
Type: text/x-patch
Size: 1409 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210921/0050603e/attachment.bin>
More information about the flang-commits
mailing list