void-packages/srcpkgs/flightgear/patches/musl-fenv.patch
Đoàn Trần Công Danh be5369a0cb srcpkgs/f*: convert patches to -Np1
* fpc is kept at -Np0

```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

19 lines
607 B
Diff

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/Main/bootstrap.cxx 2015-02-18 21:10:05.000000000 +0100
+++ b/src/Main/bootstrap.cxx 2015-11-01 01:25:56.665212195 +0100
@@ -96,8 +96,12 @@
initFPE (bool fpeAbort)
{
+#if defined(__GLIBC__)
if (fpeAbort) {
int except = fegetexcept();
feenableexcept(except | FE_DIVBYZERO | FE_INVALID);
} else {
signal(SIGFPE, handleFPE);
}
+#else
+ signal(SIGFPE, handleFPE);
+#endif