summaryrefslogtreecommitdiff
path: root/libc/include/complex.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-07-24 12:45:06 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-07-24 12:45:06 -0700
commitf34903ed6f836dc496b819ca5e246ed8ac10138c (patch)
tree068475a0a85f6ed4919d4443fb39e7027e8485ed /libc/include/complex.h
parent07a2606db934d1ecf6debe2332f713bb1feab615 (diff)
parent9e02e20878aaae4ea639246213af61378ccc728c (diff)
Merge "Revert "Retire GCC FORTIFY."" am: 758051f058
am: 9e02e20878 Change-Id: I79064de26a6642b2ff5a788c8ccb50bf91c35ab7
Diffstat (limited to 'libc/include/complex.h')
-rw-r--r--libc/include/complex.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/include/complex.h b/libc/include/complex.h
index 50da3306d..3fe8f359e 100644
--- a/libc/include/complex.h
+++ b/libc/include/complex.h
@@ -44,9 +44,15 @@ _Static_assert(__generic(_Complex_I, float _Complex, 1, 0),
#define I _Complex_I
#if __STDC_VERSION__ >= 201112L
+#ifdef __clang__
#define CMPLX(x, y) ((double complex){ x, y })
#define CMPLXF(x, y) ((float complex){ x, y })
#define CMPLXL(x, y) ((long double complex){ x, y })
+#else
+#define CMPLX(x, y) __builtin_complex((double)(x), (double)(y))
+#define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y))
+#define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y))
+#endif
#endif
__BEGIN_DECLS