void-packages/srcpkgs/occt/patches/musl-fenv.patch

56 lines
1.5 KiB
Diff

As stated by srcpkgs/flightgear/patches/musl-fenv.patch:
"""
Simply disabling the code which enables floating point exceptions
is probably wrong, but I don't have a replacement for the
non-posix functions fegetexcept(3) and feenableexcept(3).
"""
--- src/OSD/OSD_signal.cxx.orig
+++ src/OSD/OSD_signal.cxx
@@ -645,7 +645,7 @@
#include <signal.h>
-#if !defined(__ANDROID__) && !defined(__QNX__)
+#if !defined(__ANDROID__) && !defined(__QNX__) && defined(__GLIBC__)
#include <sys/signal.h>
#endif
@@ -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);
@@ -892,14 +892,18 @@
#endif
}
#elif defined (__linux__)
+#if defined(__GLIBC__)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
+#endif
fFltExceptions = Standard_True;
#endif
}
else
{
#if defined (__linux__)
+#if defined(__GLIBC__)
fedisableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
+#endif
fFltExceptions = Standard_False;
#endif
}