void-packages/srcpkgs/flightgear/patches/musl-fix_fpos_t.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

17 lines
714 B
Diff

For musl libc return the file position using
ftell(3) because fpos_t is opaque.
--- a/3rdparty/hts_engine_API/lib/HTS_misc.c 2015-02-18 21:10:05.000000000 +0100
+++ b/3rdparty/hts_engine_API/lib/HTS_misc.c 2015-10-31 17:33:53.946349145 +0100
@@ -247,8 +247,10 @@
fgetpos((FILE *) fp->pointer, &pos);
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__ANDROID__) || defined(__FreeBSD__)
return (size_t) pos;
-#else
+#elif defined(__GLIBC__)
return (size_t) pos.__pos;
+#else
+ return (size_t) ftell(fp->pointer);
#endif /* _WIN32 || __CYGWIN__ || __APPLE__ || __ANDROID__ */
}
HTS_error(0, "HTS_ftell: Unknown file type.\n");