Skip to content

Commit

Permalink
Fix Windows build with MSVC 19.41 (#2065)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
svenvh committed Sep 6, 2024
1 parent 9116bb7 commit ce68069
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test_common/harness/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ int feclearexcept(int excepts);

#if defined(__INTEL_COMPILER)
#include <mathimf.h>
#elif __cplusplus && defined(_MSC_VER)
#include <cmath>
#else
#include <math.h>
#endif
Expand Down

0 comments on commit ce68069

Please sign in to comment.