From 065da307f53e494ba4da1bfb164bc8afe7e5a5f0 Mon Sep 17 00:00:00 2001 From: nicolasWDC Date: Mon, 8 Jun 2026 09:36:53 +0000 Subject: [PATCH] include/cxx/cmath: Define FLT_EVAL_METHOD from compiler builtin Some GCC-based external toolchains define **FLT_EVAL_METHOD** but do not leave the standard FLT_EVAL_METHOD macro visible when the NuttX cmath shim evaluates its guards. As a result, C math symbols such as log and pow are declared by NuttX math.h, but are not imported into namespace std by include/cxx/cmath. Define FLT_EVAL_METHOD locally from **FLT_EVAL_METHOD** when needed in the non-CONFIG_LIBM_TOOLCHAIN path. This fixes compilation of valid C++ code using std::log and std::pow with arm-none-eabi-g++. Signed-off-by: nicolasWDC --- include/cxx/cmath | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cxx/cmath b/include/cxx/cmath index 719e625324f..a2fc0844295 100644 --- a/include/cxx/cmath +++ b/include/cxx/cmath @@ -41,6 +41,10 @@ # include +# if !defined(FLT_EVAL_METHOD) && defined(__FLT_EVAL_METHOD__) +# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ +# endif + #undef signbit #undef fpclassify #undef isfinite