[libc-commits] [libc] [libc][complex] fix compiler support matrix for cfloat128 (PR #122593)
via libc-commits
libc-commits at lists.llvm.org
Sat Jan 11 06:00:13 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Shourya Goel (Sh0g0-1758)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/122593.diff
1 Files Affected:
- (modified) libc/include/llvm-libc-types/cfloat128.h (+5-3)
``````````diff
diff --git a/libc/include/llvm-libc-types/cfloat128.h b/libc/include/llvm-libc-types/cfloat128.h
index f76a0c1c2f5af5..1a84cdf9de8d66 100644
--- a/libc/include/llvm-libc-types/cfloat128.h
+++ b/libc/include/llvm-libc-types/cfloat128.h
@@ -18,15 +18,17 @@
//
// TODO: Update the complex variant of C23 `_Float128` type detection again when
// clang supports it.
-#if defined(__STDC_IEC_60559_COMPLEX__) && !defined(__clang__)
-#if !defined(__cplusplus)
+#if !defined(__clang__)
+#if defined(__STDC_IEC_60559_COMPLEX__) || defined(__SIZEOF_FLOAT128__)
+#if defined(__GNUC__) && !defined(__cplusplus)
#define LIBC_TYPES_HAS_CFLOAT128
typedef _Complex _Float128 cfloat128;
#elif defined(__GNUC__) && __GNUC__ >= 13
#define LIBC_TYPES_HAS_CFLOAT128
typedef _Complex _Float128 cfloat128;
#endif
-#elif __clang_major__ >= 11 && \
+#endif
+#elif (__clang_major__ >= 11) && \
(defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__))
// Use _Complex __float128 type. clang uses __SIZEOF_FLOAT128__ or __FLOAT128__
// macro to notify the availability of __float128 type:
``````````
</details>
https://github.com/llvm/llvm-project/pull/122593
More information about the libc-commits
mailing list