mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 02:38:18 +00: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:
parent
fa7f85632c
commit
065da307f5
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue