blob: 444fa3ff128021844077943bf79b8bc0cebca830 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 5bd7b5d04435bd593349825973ce32290f5f604d 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] libldb: 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 4fd82a9..5443a08 100644
20--- a/third_party/cmocka/cmocka.h
21+++ b/third_party/cmocka/cmocka.h
22@@ -110,7 +110,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@@ -134,9 +134,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.7.4
45