[libc-commits] [libc] [libc] Adding FP_INT_* macro constants if missing in overlay mode. (PR #87880)

via libc-commits libc-commits at lists.llvm.org
Sat Apr 6 08:56:12 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (lntue)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) libc/hdr/math_macros.h (+21) 


``````````diff
diff --git a/libc/hdr/math_macros.h b/libc/hdr/math_macros.h
index 864afd0e50e356..d13c5ff7647ad2 100644
--- a/libc/hdr/math_macros.h
+++ b/libc/hdr/math_macros.h
@@ -17,6 +17,27 @@
 
 #include <math.h>
 
+// Some older math.h header does not have FP_INT_* constants yet.
+#ifndef FP_INT_UPWARD
+#define FP_INT_UPWARD 0
+#endif // FP_INT_UPWARD
+
+#ifndef FP_INT_DOWNWARD
+#define FP_INT_DOWNWARD 1
+#endif // FP_INT_DOWNWARD
+
+#ifndef FP_INT_TOWARDZERO
+#define FP_INT_TOWARDZERO 2
+#endif // FP_INT_TOWARDZERO
+
+#ifndef FP_INT_TONEARESTFROMZERO
+#define FP_INT_TONEARESTFROMZERO 3
+#endif // FP_INT_TONEARESTFROMZERO
+
+#ifndef FP_INT_TONEAREST
+#define FP_INT_TONEAREST 4
+#endif // FP_INT_TONEAREST
+
 #endif // LLVM_LIBC_FULL_BUILD
 
 #endif // LLVM_LIBC_HDR_MATH_MACROS_H

``````````

</details>


https://github.com/llvm/llvm-project/pull/87880


More information about the libc-commits mailing list