diff --git a/include/cxx/cmath b/include/cxx/cmath index 314f0900ac1..719e625324f 100644 --- a/include/cxx/cmath +++ b/include/cxx/cmath @@ -30,7 +30,16 @@ #include #include -#include +#if defined(CONFIG_LIBM_TOOLCHAIN) +/* In toolchain libm mode, use toolchain so it can include_next the + * matching C math.h header and populate std::* consistently. + */ + +# include_next + +#else + +# include #undef signbit #undef fpclassify @@ -222,4 +231,6 @@ namespace std } +#endif + #endif // __INCLUDE_CXX_CMATH