diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-05-16 14:40:34 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-06-03 10:20:15 +0200 |
commit | f5a5a23ea8c73f9d2a2fdcb471883989f23f9e4b (patch) | |
tree | e27fd759f462a71092ea06819247be9d459e1b0b /newlib | |
parent | 86809750bb4e6b0cda331ae9919f3d0e9bd53586 (diff) | |
download | newlib-f5a5a23ea8c73f9d2a2fdcb471883989f23f9e4b.zip newlib-f5a5a23ea8c73f9d2a2fdcb471883989f23f9e4b.tar.gz newlib-f5a5a23ea8c73f9d2a2fdcb471883989f23f9e4b.tar.bz2 |
Fix <sys/_types.h> issues with <stddef.h>
A commit from 2016 tried to address this GCC provided <stddef.h> issue
#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|| defined(__DragonFly__) \
|| defined(__FreeBSD_kernel__)
/* __size_t is a typedef on FreeBSD 5, must not trash it. */
#elif defined (__VMS__)
/* __size_t is also a typedef on VMS. */
#else
#define __size_t
#endif
with an include of <stddef.h> before <sys/_types.h> in <sys/types.h>.
Is is not robust enough. Do the include of <stddef.h> in <sys/_types.h>
directly and request only the necessary types.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/libc/include/sys/_types.h | 6 | ||||
-rw-r--r-- | newlib/libc/include/sys/types.h | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h index 0ed56ed..017a0aa 100644 --- a/newlib/libc/include/sys/_types.h +++ b/newlib/libc/include/sys/_types.h @@ -19,6 +19,9 @@ #ifndef _SYS__TYPES_H #define _SYS__TYPES_H +#define __need_size_t +#define __need_wint_t +#include <stddef.h> #include <newlib.h> #include <sys/config.h> #include <machine/_types.h> @@ -154,9 +157,6 @@ typedef long _ssize_t; typedef _ssize_t __ssize_t; -#define __need_wint_t -#include <stddef.h> - #ifndef __machine_mbstate_t_defined /* Conversion state information. */ typedef struct diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 19e3de6..4613ac8 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -42,8 +42,6 @@ typedef __intptr_t register_t; #ifndef __need_inttypes #define _SYS_TYPES_H -/* <stddef.h> must be before <sys/_types.h> for __size_t considerations */ -#include <stddef.h> #include <sys/_types.h> #include <sys/_stdint.h> |