Fix Windows build with MSVC 19.41 (#2065)

Include `cmath` instead of `math.h` in C++ mode under MSVC, to avoid
build errors inside the header.  Ideally we would not condition this
on `_MSC_VER`, but issue 1833 currently prevents doing so.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-09-06 12:26:55 +02:00
committed by GitHub
parent 9116bb7acb
commit ce680690de

View File

@@ -112,6 +112,8 @@ int feclearexcept(int excepts);
#if defined(__INTEL_COMPILER) #if defined(__INTEL_COMPILER)
#include <mathimf.h> #include <mathimf.h>
#elif __cplusplus && defined(_MSC_VER)
#include <cmath>
#else #else
#include <math.h> #include <math.h>
#endif #endif