void-packages/srcpkgs/cmocka/patches/musl_uintptr.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: 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

34 lines
1.1 KiB
Diff

commit f81e5b71ce78f33250347914dacc75c8463bf102
Author: Breno Leitao <breno.leitao@gmail.com>
Date: Wed Mar 29 15:22:38 2017 -0300
include: Check for previous declaration of uintptr_t
Adding a extra check before declaring uintptr_t. Currently musl uses
macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking
this macro before defining it, and, defining it when uintptr_t is
defined.
Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -110,7 +110,7 @@
((LargestIntegralType)(value))
/* Smallest integral type capable of holding a pointer. */
-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
+#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(__DEFINED_uintptr_t)
# if defined(_WIN32)
/* WIN32 is an ILP32 platform */
typedef unsigned int uintptr_t;
@@ -136,6 +136,8 @@
# define _UINTPTR_T
# define _UINTPTR_T_DEFINED
+# define __DEFINED_uintptr_t
+
#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
/* Perform an unsigned cast to uintptr_t. */