From 2dcdd36d188b15a16fd0d154a423fa0ceb0e1e07 Mon Sep 17 00:00:00 2001 From: Andrew Bassett <43486400+apbassett@users.noreply.github.com> Date: Wed, 3 Jul 2024 08:18:15 -0400 Subject: [PATCH] 20765: Turns off several exceptions in universal initialization (#165) Disables several exceptions that are being suppressed by Python up the stack but are affecting the Evolver: FE_INEXACT, FE_DIVBYZERO, FE_UNDERFLOW, FE_OVERFLOW, and FE_INVALID. --- src/Amalgam/PlatformSpecific.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Amalgam/PlatformSpecific.cpp b/src/Amalgam/PlatformSpecific.cpp index b20f9d15..97eb87df 100644 --- a/src/Amalgam/PlatformSpecific.cpp +++ b/src/Amalgam/PlatformSpecific.cpp @@ -7,12 +7,24 @@ #include #include #include +#include #include #include #include #include #include +//perform universal initialization +class PlatformSpecificStartup +{ +public: + PlatformSpecificStartup() + { + std::feclearexcept(FE_ALL_EXCEPT); + } +}; +PlatformSpecificStartup _platform_specific_startup; + #ifdef OS_WINDOWS // TODO 15993: disable std::wstring_convert deprecation warning: no replacement in C++17 so