mirror of
https://github.com/apache/nuttx.git
synced 2026-09-21 21:47:28 +08:00
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:
committed by
Alan C. Assis
parent
fa7f85632c
commit
065da307f5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user