void-packages/srcpkgs/occt/patches/musl-fenv.patch
Karl Nilsson 1c23d710f7 Revert "occt: update to 7.5.0."
OCCT 7.5.0 breaks ABI, and downstream packages such as FreeCAD fail to
build.

Keep the license change. We should also stick with their repository
instead of GitHub, which doesn't have all the releases.

This reverts commit abe75dc062.

Closes: #29541 [via git-merge-pr]
2021-03-17 14:19:32 -03:00

36 lines
1.1 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
@@ -703,7 +703,7 @@
#include <signal.h>
-#if !defined(__ANDROID__) && !defined(__QNX__)
+#if !defined(__ANDROID__) && !defined(__QNX__) && defined(__GLIBC__)
#include <sys/signal.h>
#endif
@@ -914,7 +914,7 @@
//=======================================================================
void OSD::SetFloatingSignal (Standard_Boolean theFloatingSignal)
{
-#if defined (__linux__)
+#if defined (__linux__) && defined(__GLIBC__)
feclearexcept (FE_ALL_EXCEPT);
if (theFloatingSignal)
{
@@ -947,7 +947,7 @@
//=======================================================================
Standard_Boolean OSD::ToCatchFloatingSignals()
{
-#if defined (__linux__)
+#if defined (__linux__) && defined(__GLIBC__)
return (fegetexcept() & _OSD_FPX) != 0;
#else
return Standard_False;