void-packages/srcpkgs/occt/patches/musl-fenv.patch
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07: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).
"""
--- a/src/OSD/OSD_signal.cxx
+++ b/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;