vp-build/srcpkgs/oce/patches/musl-fenv.patch

37 lines
1.3 KiB
Diff

Following 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 2016-01-02 06:11:52.000000000 +0100
+++ src/OSD/OSD_signal.cxx 2016-06-03 13:12:26.271621527 +0200
@@ -216,7 +216,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);
@@ -337,7 +337,7 @@
return;
}
#endif
-#ifdef linux
+#if defined(linux) && defined(__GLIBC__)
if (fFltExceptions)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
//feenableexcept (FE_INVALID | FE_DIVBYZERO);
@@ -393,7 +393,7 @@
cerr << "ieee_handler does not work !!! KO " << endl;
#endif
}
-#elif defined (linux)
+#elif defined(linux) && defined(__GLIBC__)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
//feenableexcept (FE_INVALID | FE_DIVBYZERO);
fFltExceptions = Standard_True;