Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From 5bd7b5d04435bd593349825973ce32290f5f604d Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Wed, 25 Jul 2018 09:55:25 +0800 |
| 4 | Subject: [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 | ^~~~~~~~~ |
| 9 | use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | |
| 13 | Signed-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 | |
| 18 | diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h |
| 19 | index 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 | -- |
| 44 | 2.7.4 |
| 45 | |