aports/community/opencascade/no_feenableexcept.patch
2025-10-31 20:33:07 +00:00

26 lines
884 B
Diff

musl does not provice feenableexcept and fedisableexcept. Those calls have
only been used on linux so far. This patch extends the #ifdef logic to only use
them on Linux if additionally glibc is used.
diff --git a/src/OSD/OSD_signal.cxx b/src/OSD/OSD_signal.cxx
index 0545d7496d..475edd0f71 100644
--- a/src/OSD/OSD_signal.cxx
+++ b/src/OSD/OSD_signal.cxx
@@ -744,7 +744,7 @@ LONG _osd_debug(void)
// POSIX threads
#include <pthread.h>
- #ifdef __linux__
+ #ifdef __linux__ && defined(__GLIBC__)
#include <cfenv>
// #include <fenv.h>
#endif
@@ -866,7 +866,7 @@ static void Handler(const int theSignal)
case SIGFPE:
sigaddset(&set, SIGFPE);
sigprocmask(SIG_UNBLOCK, &set, NULL);
- #ifdef __linux__
+ #ifdef __linux__ && defined(__GLIBC__)
OSD::SetFloatingSignal(Standard_True);
#endif
#if (!defined(__sun)) && (!defined(SOLARIS))