Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [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] samba: cmocka.h: fix musl libc conflicting types error |
| 5 | |
| 6 | Fix build on qemumips64(el) |
| 7 | |
| 8 | taken from: |
| 9 | [PATCH] libldb: fix musl libc conflicting types error |
| 10 | |
| 11 | /third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t' |
| 12 | typedef unsigned int uintptr_t; |
| 13 | ^~~~~~~~~ |
| 14 | use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined |
| 15 | |
| 16 | Upstream-Status: Pending |
| 17 | |
| 18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 19 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> |
| 20 | |
| 21 | Taken from [PATCH] samba: cmocka.h: fix musl libc conflicting types error |
| 22 | https://git.openembedded.org/meta-openembedded/commit/meta-networking/recipes-connectivity/samba?id=b758150d30a5fbdc47c465d0e9dca3a7e6d71f3c |
| 23 | |
| 24 | Signed-off-by: Armin Kuster <akuster808@gmail.com> |
| 25 | |
| 26 | This fix is not in cmocka, so pending pending?? |
| 27 | |
| 28 | |
| 29 | Index: git/include/cmocka.h |
| 30 | =================================================================== |
| 31 | --- git.orig/include/cmocka.h |
| 32 | +++ git/include/cmocka.h |
| 33 | @@ -116,7 +116,7 @@ typedef uintmax_t LargestIntegralType; |
| 34 | ((LargestIntegralType)(value)) |
| 35 | |
| 36 | /* Smallest integral type capable of holding a pointer. */ |
| 37 | -#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) |
| 38 | +#if !defined(__DEFINED_uintptr_t) |
| 39 | # if defined(_WIN32) |
| 40 | /* WIN32 is an ILP32 platform */ |
| 41 | typedef unsigned int uintptr_t; |
| 42 | @@ -140,9 +140,8 @@ typedef uintmax_t LargestIntegralType; |
| 43 | # endif /* __WORDSIZE */ |
| 44 | # endif /* _WIN32 */ |
| 45 | |
| 46 | -# define _UINTPTR_T |
| 47 | -# define _UINTPTR_T_DEFINED |
| 48 | -#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */ |
| 49 | +# define __DEFINED_uintptr_t |
| 50 | +#endif /* !defined(__DEFINED_uintptr_t) */ |
| 51 | |
| 52 | /* Perform an unsigned cast to uintptr_t. */ |
| 53 | #define cast_to_pointer_integral_type(value) \ |