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

via libc-commits libc-commits at lists.llvm.org
Sat Apr 6 14:38:50 PDT 2024


Author: lntue
Date: 2024-04-06T17:38:47-04:00
New Revision: 7248c9feb9023335ae45265f59a8752da42fb4c4

URL: https://github.com/llvm/llvm-project/commit/7248c9feb9023335ae45265f59a8752da42fb4c4
DIFF: https://github.com/llvm/llvm-project/commit/7248c9feb9023335ae45265f59a8752da42fb4c4.diff

LOG: [libc] Adding FP_INT_* macro constants if missing in overlay mode. (#87880)

Added: 
    

Modified: 
    libc/hdr/math_macros.h

Removed: 
    


################################################################################
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


        


More information about the libc-commits mailing list