blob: 5795ff3bd1f4391c3ed55adfd683234338589aa8 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 1d4dedab5039bb671f44566d8573ee3532ba7176 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Wed, 25 Jul 2018 09:55:25 +0800
4Subject: [PATCH] cmocka: fix musl libc conflicting types error
5
6/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
7 typedef unsigned int uintptr_t;
8 ^~~~~~~~~
9use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
10
11Upstream-Status: Pending
12
13Signed-off-by: Changqing Li <changqing.li@windriver.com>
14---
15 third_party/cmocka/cmocka.h | 7 +++----
16 1 file changed, 3 insertions(+), 4 deletions(-)
17
18diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
19index e6861c8..238201d 100644
20--- a/third_party/cmocka/cmocka.h
21+++ b/third_party/cmocka/cmocka.h
22@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
23 ((LargestIntegralType)(value))
24
25 /* Smallest integral type capable of holding a pointer. */
26-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
27+#if !defined(__DEFINED_uintptr_t)
28 # if defined(_WIN32)
29 /* WIN32 is an ILP32 platform */
30 typedef unsigned int uintptr_t;
31@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
32 # endif /* __WORDSIZE */
33 # endif /* _WIN32 */
34
35-# define _UINTPTR_T
36-# define _UINTPTR_T_DEFINED
37-#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
38+# define __DEFINED_uintptr_t
39+#endif /* !defined(__DEFINED_uintptr_t) */
40
41 /* Perform an unsigned cast to uintptr_t. */
42 #define cast_to_pointer_integral_type(value) \
43--
442.25.1
45