void-packages/srcpkgs/libmemcached/patches/musl-fixes.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

51 lines
1.2 KiB
Diff

diff --git libhashkit/fnv_64.cc libhashkit/fnv_64.cc
index 68e4dd0..88bbace 100644
--- a/libhashkit/fnv_64.cc
+++ b/libhashkit/fnv_64.cc
@@ -37,6 +37,9 @@
#include <libhashkit/common.h>
+#ifndef __GLIBC__
+#include <sys/reg.h>
+#endif
#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
diff --git libhashkit/has.cc libhashkit/has.cc
index 843e32e..7dbadc3 100644
--- a/libhashkit/has.cc
+++ b/libhashkit/has.cc
@@ -37,6 +37,9 @@
#include <libhashkit/common.h>
+#ifndef __GLIBC__
+#include <sys/reg.h>
+#endif
bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
{
diff --git libtest/cmdline.cc libtest/cmdline.cc
index 29a22de..161c646 100644
--- a/libtest/cmdline.cc
+++ b/libtest/cmdline.cc
@@ -61,7 +61,7 @@ using namespace libtest;
#include <algorithm>
#include <stdexcept>
-#ifndef __USE_GNU
+#ifndef _GNU_SOURCE
static char **environ= NULL;
#endif
@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[])
fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
+#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__)
// Use USEVFORK on linux
flags |= POSIX_SPAWN_USEVFORK;
#endif