void-packages/srcpkgs/mplayer/patches/altivec-gcc83.patch
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: 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

18 lines
592 B
Diff

--- a/ffmpeg/libavutil/ppc/util_altivec.h
+++ b/ffmpeg/libavutil/ppc/util_altivec.h
@@ -54,6 +54,15 @@
#if HAVE_ALTIVEC
#include <altivec.h>
+/* starting with gcc 8.3, the vector keyword no longer allows usage with
+ * typedefs (e.g. vector uint32_t), only with their respective basic types
+ * (e.g. vector unsigned int) - with __vector this still works and there
+ * is code relying on it
+ */
+#ifndef vector
+#define vector __vector
+#endif
+
// used to build registers permutation vectors (vcprm)
// the 's' are for words in the _s_econd vector
#define WORD_0 0x00,0x01,0x02,0x03