Skip to content

Commit 3825711

Browse files
committed
Guard against missing math_errhandling macro
include/ChangeLog: * bits/simd_details.h:
1 parent dc54d73 commit 3825711

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

include/bits/simd_details.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,15 @@ namespace simd
533533

534534
// Determine if math functions must *raise* floating-point exceptions.
535535
// math_errhandling may expand to an extern symbol, in which case we must assume fp exceptions
536-
// need to be considered.
536+
// need to be considered. A conforming C library must define math_errhandling, but in case it
537+
// isn't defined we simply use the fallback.
538+
#ifdef math_errhandling
537539
template <int = 0>
538540
requires requires { typename bool_constant<0 != (math_errhandling & MATH_ERREXCEPT)>; }
539541
consteval bool
540542
__handle_fpexcept_impl(int)
541543
{ return 0 != (math_errhandling & MATH_ERREXCEPT); }
544+
#endif
542545

543546
// Fallback if math_errhandling doesn't work: implement correct exception behavior.
544547
consteval bool

0 commit comments

Comments
 (0)