summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2021-06-06 19:56:14 -0600
committerPatrick Georgi <pgeorgi@google.com>2021-06-10 05:36:30 +0000
commit26979ca47036ac6d50a3d9f186b6c420fd4a243f (patch)
treeea0185262868f08892eae734952f04142cd4a17c
parent3d2ef9aea954ee32567385d71dbf97f46e6ad641 (diff)
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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55260 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--src/include/stddef.h9
1 files changed, 3 insertions, 6 deletions
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 <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__ 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)