Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 9b951c8f6b0aaff7c16dc4db72b5e56ec73810bb Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 3 Feb 2017 12:56:00 -0800 |
| 4 | Subject: [PATCH 47/47] sync gcc stddef.h with musl |
| 5 | |
| 6 | musl defines ptrdiff_t size_t and wchar_t |
| 7 | so dont define them here if musl is definining them |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | Upstream-Status: Inappropriate [OE-Specific] |
| 12 | |
| 13 | gcc/ginclude/stddef.h | 9 +++++++++ |
| 14 | 1 file changed, 9 insertions(+) |
| 15 | |
| 16 | diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h |
| 17 | index 872f451cac9..7e90938387c 100644 |
| 18 | --- a/gcc/ginclude/stddef.h |
| 19 | +++ b/gcc/ginclude/stddef.h |
| 20 | @@ -134,6 +134,7 @@ _TYPE_wchar_t; |
| 21 | #ifndef ___int_ptrdiff_t_h |
| 22 | #ifndef _GCC_PTRDIFF_T |
| 23 | #ifndef _PTRDIFF_T_DECLARED /* DragonFly */ |
| 24 | +#ifndef __DEFINED_ptrdiff_t /* musl */ |
| 25 | #define _PTRDIFF_T |
| 26 | #define _T_PTRDIFF_ |
| 27 | #define _T_PTRDIFF |
| 28 | @@ -143,10 +144,12 @@ _TYPE_wchar_t; |
| 29 | #define ___int_ptrdiff_t_h |
| 30 | #define _GCC_PTRDIFF_T |
| 31 | #define _PTRDIFF_T_DECLARED |
| 32 | +#define __DEFINED_ptrdiff_t /* musl */ |
| 33 | #ifndef __PTRDIFF_TYPE__ |
| 34 | #define __PTRDIFF_TYPE__ long int |
| 35 | #endif |
| 36 | typedef __PTRDIFF_TYPE__ ptrdiff_t; |
| 37 | +#endif /* __DEFINED_ptrdiff_t */ |
| 38 | #endif /* _PTRDIFF_T_DECLARED */ |
| 39 | #endif /* _GCC_PTRDIFF_T */ |
| 40 | #endif /* ___int_ptrdiff_t_h */ |
| 41 | @@ -184,6 +187,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; |
| 42 | #ifndef _GCC_SIZE_T |
| 43 | #ifndef _SIZET_ |
| 44 | #ifndef __size_t |
| 45 | +#ifndef __DEFINED_size_t /* musl */ |
| 46 | #define __size_t__ /* BeOS */ |
| 47 | #define __SIZE_T__ /* Cray Unicos/Mk */ |
| 48 | #define _SIZE_T |
| 49 | @@ -200,6 +204,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; |
| 50 | #define ___int_size_t_h |
| 51 | #define _GCC_SIZE_T |
| 52 | #define _SIZET_ |
| 53 | +#define __DEFINED_size_t /* musl */ |
| 54 | #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ |
| 55 | || defined(__DragonFly__) \ |
| 56 | || defined(__FreeBSD_kernel__) |
| 57 | @@ -235,6 +240,7 @@ typedef long ssize_t; |
| 58 | #endif /* _SIZE_T */ |
| 59 | #endif /* __SIZE_T__ */ |
| 60 | #endif /* __size_t__ */ |
| 61 | +#endif /* __DEFINED_size_t */ |
| 62 | #undef __need_size_t |
| 63 | #endif /* _STDDEF_H or __need_size_t. */ |
| 64 | |
| 65 | @@ -264,6 +270,7 @@ typedef long ssize_t; |
| 66 | #ifndef ___int_wchar_t_h |
| 67 | #ifndef __INT_WCHAR_T_H |
| 68 | #ifndef _GCC_WCHAR_T |
| 69 | +#ifndef __DEFINED_wchar_t /* musl */ |
| 70 | #define __wchar_t__ /* BeOS */ |
| 71 | #define __WCHAR_T__ /* Cray Unicos/Mk */ |
| 72 | #define _WCHAR_T |
| 73 | @@ -279,6 +286,7 @@ typedef long ssize_t; |
| 74 | #define __INT_WCHAR_T_H |
| 75 | #define _GCC_WCHAR_T |
| 76 | #define _WCHAR_T_DECLARED |
| 77 | +#define __DEFINED_wchar_t /* musl */ |
| 78 | |
| 79 | /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ |
| 80 | instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other |
| 81 | @@ -344,6 +352,7 @@ typedef __WCHAR_TYPE__ wchar_t; |
| 82 | #endif |
| 83 | #endif /* __WCHAR_T__ */ |
| 84 | #endif /* __wchar_t__ */ |
| 85 | +#endif /* __DEFINED_wchar_t musl */ |
| 86 | #undef __need_wchar_t |
| 87 | #endif /* _STDDEF_H or __need_wchar_t. */ |
| 88 | |
| 89 | -- |
| 90 | 2.12.2 |
| 91 | |