From 0d296cc2d3b8e2ffa46b4a93d1398fa6bf85b504 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 15 Oct 2014 04:38:30 -0600 Subject: Provide option to avoid defining a custom version of uintptr_t. There's a definition in stdint.h (provided by gcc) which will be more correct if available. Define CONFIG_USE_STDINT to use this feature, or USE_STDINT=1 on the 'make' commmand. This adjusts the settings for x86 and sandbox, with both have 64-bit options. Signed-off-by: Gabe Black Reviewed-by: Gabe Black Tested-by: Gabe Black Reviewed-by: Bill Richardson Rewritten to be an option, since stdint.h is often available only in glibc. Changed to preserve a clear boundary between stdint and non-stdint Signed-off-by: Simon Glass --- include/compiler.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/compiler.h') diff --git a/include/compiler.h b/include/compiler.h index 21036022d7..47c296e202 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -112,6 +112,14 @@ typedef unsigned int uint; #else /* !USE_HOSTCC */ +#ifdef CONFIG_USE_STDINT +/* Provided by gcc. */ +#include +#else +/* Type for `void *' pointers. */ +typedef unsigned long int uintptr_t; +#endif + #include #include #include @@ -128,9 +136,6 @@ typedef unsigned int uint; #define __WORDSIZE 32 #endif -/* Type for `void *' pointers. */ -typedef unsigned long int uintptr_t; - #endif /* USE_HOSTCC */ #define likely(x) __builtin_expect(!!(x), 1) -- cgit v1.2.1