0030-sync-gcc-stddef.h-with-musl.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From a9173429ae256c4b4a3ab4d758a6adf42f8c4239 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] sync gcc stddef.h with musl
  5. musl defines ptrdiff_t size_t and wchar_t
  6. so dont define them here if musl is definining them
  7. Upstream-Status: Pending
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. gcc/ginclude/stddef.h | 9 +++++++++
  11. 1 file changed, 9 insertions(+)
  12. diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
  13. index 66619fe43b1..3f843d6f365 100644
  14. --- a/gcc/ginclude/stddef.h
  15. +++ b/gcc/ginclude/stddef.h
  16. @@ -128,6 +128,7 @@ _TYPE_wchar_t;
  17. #ifndef ___int_ptrdiff_t_h
  18. #ifndef _GCC_PTRDIFF_T
  19. #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
  20. +#ifndef __DEFINED_ptrdiff_t /* musl */
  21. #define _PTRDIFF_T
  22. #define _T_PTRDIFF_
  23. #define _T_PTRDIFF
  24. @@ -137,10 +138,12 @@ _TYPE_wchar_t;
  25. #define ___int_ptrdiff_t_h
  26. #define _GCC_PTRDIFF_T
  27. #define _PTRDIFF_T_DECLARED
  28. +#define __DEFINED_ptrdiff_t /* musl */
  29. #ifndef __PTRDIFF_TYPE__
  30. #define __PTRDIFF_TYPE__ long int
  31. #endif
  32. typedef __PTRDIFF_TYPE__ ptrdiff_t;
  33. +#endif /* __DEFINED_ptrdiff_t */
  34. #endif /* _PTRDIFF_T_DECLARED */
  35. #endif /* _GCC_PTRDIFF_T */
  36. #endif /* ___int_ptrdiff_t_h */
  37. @@ -178,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
  38. #ifndef _GCC_SIZE_T
  39. #ifndef _SIZET_
  40. #ifndef __size_t
  41. +#ifndef __DEFINED_size_t /* musl */
  42. #define __size_t__ /* BeOS */
  43. #define __SIZE_T__ /* Cray Unicos/Mk */
  44. #define _SIZE_T
  45. @@ -194,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
  46. #define ___int_size_t_h
  47. #define _GCC_SIZE_T
  48. #define _SIZET_
  49. +#define __DEFINED_size_t /* musl */
  50. #if defined (__FreeBSD__) \
  51. || defined(__DragonFly__) \
  52. || defined(__FreeBSD_kernel__) \
  53. @@ -228,6 +233,7 @@ typedef long ssize_t;
  54. #endif /* _SIZE_T */
  55. #endif /* __SIZE_T__ */
  56. #endif /* __size_t__ */
  57. +#endif /* __DEFINED_size_t */
  58. #undef __need_size_t
  59. #endif /* _STDDEF_H or __need_size_t. */
  60. @@ -257,6 +263,7 @@ typedef long ssize_t;
  61. #ifndef ___int_wchar_t_h
  62. #ifndef __INT_WCHAR_T_H
  63. #ifndef _GCC_WCHAR_T
  64. +#ifndef __DEFINED_wchar_t /* musl */
  65. #define __wchar_t__ /* BeOS */
  66. #define __WCHAR_T__ /* Cray Unicos/Mk */
  67. #define _WCHAR_T
  68. @@ -272,6 +279,7 @@ typedef long ssize_t;
  69. #define __INT_WCHAR_T_H
  70. #define _GCC_WCHAR_T
  71. #define _WCHAR_T_DECLARED
  72. +#define __DEFINED_wchar_t /* musl */
  73. /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
  74. instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
  75. @@ -337,6 +345,7 @@ typedef __WCHAR_TYPE__ wchar_t;
  76. #endif
  77. #endif /* __WCHAR_T__ */
  78. #endif /* __wchar_t__ */
  79. +#endif /* __DEFINED_wchar_t musl */
  80. #undef __need_wchar_t
  81. #endif /* _STDDEF_H or __need_wchar_t. */