Skip to content

[libc] fix woa64 fenv implementation #119155

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 9, 2024

Conversation

SchrodingerZhu
Copy link
Contributor

@SchrodingerZhu SchrodingerZhu commented Dec 9, 2024

Changing name type to match x86-64. This resolves definition conflicts with core_crt headers.

fix #119154

@SchrodingerZhu SchrodingerZhu requested a review from lntue December 9, 2024 00:48
@llvmbot llvmbot added the libc label Dec 9, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 9, 2024

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

Changes

Use push_macro/pop_macro to avoid UNDERFLOW OVERFLOW conflict with core_crt headers. fix #119154.


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

1 Files Affected:

  • (modified) libc/src/__support/FPUtil/aarch64/FEnvImpl.h (+6-1)
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 3cea9772154fc6..ff3485de4a007d 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -26,7 +26,10 @@
 
 namespace LIBC_NAMESPACE_DECL {
 namespace fputil {
-
+#pragma push_macro("OVERFLOW")
+#undef OVERFLOW
+#pragma push_macro("UNDERFLOW")
+#undef UNDERFLOW
 struct FEnv {
   struct FPState {
     uint32_t ControlWord;
@@ -279,6 +282,8 @@ LIBC_INLINE int set_env(const fenv_t *envp) {
   return 0;
 }
 
+#pragma pop_macro("UNDERFLOW")
+#pragma pop_macro("OVERFLOW")
 } // namespace fputil
 } // namespace LIBC_NAMESPACE_DECL
 

@SchrodingerZhu SchrodingerZhu merged commit f91a5fe into llvm:main Dec 9, 2024
7 checks passed
@SchrodingerZhu SchrodingerZhu deleted the libc/woa64-fenv branch December 9, 2024 01:25
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.

[libc][math][windows] math tests cannot build with windows SDK 10.0.22621.0
3 participants