1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-24 11:45:18 +03:00
aports/testing/opencascade/no_feenableexcept.patch
2019-10-22 22:41:30 +02:00

40 lines
1.4 KiB
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.
--- occt-V7_3_0p3.old/src/OSD/OSD_signal.cxx
+++ occt-V7_3_0p3/src/OSD/OSD_signal.cxx
@@ -687,7 +687,7 @@
// cout << "OSD::Handler: signal " << (int) theSignal << " occured inside a try block " << endl ;
if ( ADR_ACT_SIGIO_HANDLER != NULL )
(*ADR_ACT_SIGIO_HANDLER)() ;
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__)
if (fFltExceptions)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
//feenableexcept (FE_INVALID | FE_DIVBYZERO);
@@ -805,7 +805,7 @@
(void)theSignal; // silence GCC warnings
(void)theContext;
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__)
if (fFltExceptions)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
//feenableexcept (FE_INVALID | FE_DIVBYZERO);
@@ -891,14 +891,14 @@
cerr << "ieee_handler does not work !!! KO " << endl;
#endif
}
-#elif defined (__linux__)
+#elif defined(__linux__) && defined(__GLIBC__)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
fFltExceptions = Standard_True;
#endif
}
else
{
-#if defined (__linux__)
+#if defined(__linux__) && defined(__GLIBC__)
fedisableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
fFltExceptions = Standard_False;
#endif