From 26979ca47036ac6d50a3d9f186b6c420fd4a243f Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Sun, 6 Jun 2021 19:56:14 -0600 Subject: 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 Change-Id: I0874eddf780b6e41ce773ad8b4faa595e4bbd8a7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55260 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Julius Werner --- src/include/stddef.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/include/stddef.h b/src/include/stddef.h index b668b1aeb6..190413c6a2 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -3,10 +3,7 @@ #include -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__ size_t; 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) -- cgit v1.2.3