[libc-commits] [libc] ca88a0e - [libc][complex] fix guard for cfloat128 and float128 (#119330)
via libc-commits
libc-commits at lists.llvm.org
Mon Dec 9 22:08:43 PST 2024
Author: Shourya Goel
Date: 2024-12-10T11:38:40+05:30
New Revision: ca88a0e6f22c191a6f9a4e6547b993da8e11bb73
URL: https://github.com/llvm/llvm-project/commit/ca88a0e6f22c191a6f9a4e6547b993da8e11bb73
DIFF: https://github.com/llvm/llvm-project/commit/ca88a0e6f22c191a6f9a4e6547b993da8e11bb73.diff
LOG: [libc][complex] fix guard for cfloat128 and float128 (#119330)
Added:
Modified:
libc/src/__support/complex_type.h
Removed:
################################################################################
diff --git a/libc/src/__support/complex_type.h b/libc/src/__support/complex_type.h
index 88239886f983b5..a6207d38d0eb57 100644
--- a/libc/src/__support/complex_type.h
+++ b/libc/src/__support/complex_type.h
@@ -36,13 +36,12 @@ template <> struct make_complex<float16> {
using type = cfloat16;
};
#endif
-#if defined(LIBC_TYPES_HAS_CFLOAT128)
-#if !(LIBC_TYPES_LONG_DOUBLE_IS_FLOAT128)
+#if defined(LIBC_TYPES_HAS_CFLOAT128) && \
+ !defined(LIBC_TYPES_LONG_DOUBLE_IS_FLOAT128)
template <> struct make_complex<float128> {
using type = cfloat128;
};
#endif
-#endif
template <typename T> using make_complex_t = typename make_complex<T>::type;
@@ -63,13 +62,12 @@ template <> struct make_real<cfloat16> {
using type = float16;
};
#endif
-#if defined(LIBC_TYPES_HAS_CFLOAT128)
-#if !(LIBC_TYPES_CFLOAT128_IS_COMPLEX_LONG_DOUBLE)
+#if defined(LIBC_TYPES_HAS_CFLOAT128) && \
+ !defined(LIBC_TYPES_CFLOAT128_IS_COMPLEX_LONG_DOUBLE)
template <> struct make_real<cfloat128> {
using type = float128;
};
#endif
-#endif
template <typename T> using make_real_t = typename make_real<T>::type;
More information about the libc-commits
mailing list