This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 1dd8178bdc float.h: Define FLT_ROUNDS if not defined by toolchain
previously
1dd8178bdc is described below
commit 1dd8178bdc63a8be65576124349c02303a40bc03
Author: Tiago Medicci Serrano <[email protected]>
AuthorDate: Mon Dec 2 14:39:46 2024 -0300
float.h: Define FLT_ROUNDS if not defined by toolchain previously
This value is necessary to build third-party applications on NuttX.
If not defined previously by the toolchain, define it at NuttX's
`lib/float.h`.
---
include/nuttx/lib/float.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/nuttx/lib/float.h b/include/nuttx/lib/float.h
index b15f52c360..d130022d9c 100644
--- a/include/nuttx/lib/float.h
+++ b/include/nuttx/lib/float.h
@@ -42,6 +42,12 @@
#define FLT_RADIX 2
+/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
+
+#ifndef FLT_ROUNDS /* May be defined in a toolchain header */
+# define FLT_ROUNDS 1
+#endif
+
/* Number of base-FLT_RADIX digits in the floating-point significand, p. */
#ifndef FLT_MANT_DIG /* May be defined in a toolchain header */