Skip to content

[libc][complex] fix guard for cfloat128 and float128 #119330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

Sh0g0-1758
Copy link
Member

No description provided.

@Sh0g0-1758 Sh0g0-1758 merged commit ca88a0e into llvm:main Dec 10, 2024
9 of 11 checks passed
@llvmbot llvmbot added the libc label Dec 10, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2024

@llvm/pr-subscribers-libc

Author: Shourya Goel (Sh0g0-1758)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/119330.diff

1 Files Affected:

  • (modified) libc/src/__support/complex_type.h (+4-6)
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;
 

@Sh0g0-1758 Sh0g0-1758 mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants