Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From 1d4dedab5039bb671f44566d8573ee3532ba7176 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] 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 | ^~~~~~~~~ |
| 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 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 | -- |
| 44 | 2.25.1 |
| 45 | |