Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/55260 )
Change subject: stddef.h: Use compiler macros for built-in integer types ......................................................................
stddef.h: Use compiler macros for built-in integer types
ptrdiff_t, wchar_t, and wint_t are all integer types built-in to the C language (as opposed to being library-only types defined in a header). In the past we had to define these typedefs ourselves because of romcc, but now that it's gone we should use the GCC-provided macros to select the types the compiler expects.
Signed-off-by: Jacob Garber jgarber1@ualberta.ca Change-Id: I0874eddf780b6e41ce773ad8b4faa595e4bbd8a7 --- M src/include/stddef.h 1 file changed, 3 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/55260/1
diff --git a/src/include/stddef.h b/src/include/stddef.h index b668b1a..190413c 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -3,10 +3,7 @@
#include <commonlib/helpers.h>
-typedef long ptrdiff_t; -#ifndef __SIZE_TYPE__ -#define __SIZE_TYPE__ unsigned long -#endif +typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __SIZE_TYPE__ size_t; /* There is a GCC macro for a size_t type, but not * for a ssize_t type. Below construct tricks GCC @@ -16,8 +13,8 @@ typedef __SIZE_TYPE__ ssize_t; #undef unsigned
-typedef int wchar_t; -typedef unsigned int wint_t; +typedef __WCHAR_TYPE__ wchar_t; +typedef __WINT_TYPE__ wint_t;
#define NULL ((void *)0)