[libc-commits] [libc] [libc][complex] check that cfloat128 is not defined as _Complex long double (PR #119324)

Shourya Goel via libc-commits libc-commits at lists.llvm.org
Mon Dec 9 21:09:14 PST 2024


https://github.com/Sh0g0-1758 created https://github.com/llvm/llvm-project/pull/119324

Fix buildbot errors in #118671 

>From 8f3e7c3fb0552fcfffcf22e74761291e5c21d748 Mon Sep 17 00:00:00 2001
From: Sh0g0-1758 <shouryagoel10000 at gmail.com>
Date: Tue, 10 Dec 2024 10:37:43 +0530
Subject: [PATCH] fix: check that cfloat128 is not defined _Complex long double

---
 libc/src/__support/complex_type.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libc/src/__support/complex_type.h b/libc/src/__support/complex_type.h
index 4c861b05bc752c..7d9f21229fa94e 100644
--- a/libc/src/__support/complex_type.h
+++ b/libc/src/__support/complex_type.h
@@ -37,10 +37,12 @@ template <> struct make_complex<float16> {
 };
 #endif
 #if defined(LIBC_TYPES_HAS_CFLOAT128)
+#if (LDBL_MANT_DIG != 113)
 template <> struct make_complex<float128> {
   using type = cfloat128;
 };
 #endif
+#endif
 
 template <typename T> using make_complex_t = typename make_complex<T>::type;
 
@@ -62,10 +64,12 @@ template <> struct make_real<cfloat16> {
 };
 #endif
 #if defined(LIBC_TYPES_HAS_CFLOAT128)
+#if (LDBL_MANT_DIG != 113)
 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