void-packages/srcpkgs/libmad/patches/mips-mode_di.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: 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

27 lines
708 B
Diff

--- a/fixed.h 2004-02-17 03:02:03.000000000 +0100
+++ b/fixed.h 2017-12-03 21:02:42.248609296 +0100
@@ -299,6 +299,16 @@
# elif defined(FPM_MIPS)
+#if 1
+
+typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
+#define MAD_F_MLX(hi, lo, x, y) \
+ do { \
+ u64_di_t __ll = (u64_di_t) (x) * (y); \
+ hi = __ll >> 32; \
+ lo = __ll; \
+ } while (0)
+#else
/*
* This MIPS version is fast and accurate; the disposition of the least
* significant bit depends on OPT_ACCURACY via mad_f_scale64().
@@ -328,6 +338,7 @@
: "%r" ((x) >> 12), "r" ((y) >> 16))
# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
# endif
+#endif
# if defined(OPT_SPEED)
# define mad_f_scale64(hi, lo) \