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 <nicolasWDC@users.noreply.github.com>
This commit is contained in:
nicolasWDC 2026-06-08 09:36:53 +00:00 committed by Alan C. Assis
parent fa7f85632c
commit 065da307f5

View file

@ -41,6 +41,10 @@
# include <math.h>
# if !defined(FLT_EVAL_METHOD) && defined(__FLT_EVAL_METHOD__)
# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
# endif
#undef signbit
#undef fpclassify
#undef isfinite