diff options
author | Gabe Black <gabeblack@chromium.org> | 2014-10-15 04:38:30 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-10-27 11:04:01 -0400 |
commit | 0d296cc2d3b8e2ffa46b4a93d1398fa6bf85b504 (patch) | |
tree | 25c0cadf3c5056cbe0c72ab19c932293428b5615 /include | |
parent | 4bf3a56f2b2c7c7bbf3825484d361d564a270783 (diff) |
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 <gabeblack@google.com>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@google.com>
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 <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/compiler.h | 11 | ||||
-rw-r--r-- | include/linux/types.h | 9 |
2 files changed, 16 insertions, 4 deletions
diff --git a/include/compiler.h b/include/compiler.h index 21036022d7a..47c296e202d 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 <stdint.h> +#else +/* Type for `void *' pointers. */ +typedef unsigned long int uintptr_t; +#endif + #include <linux/string.h> #include <linux/types.h> #include <asm/byteorder.h> @@ -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) diff --git a/include/linux/types.h b/include/linux/types.h index 9aebc4e8cf0..c9a8d9a8c2c 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -104,7 +104,8 @@ typedef __u8 uint8_t; typedef __u16 uint16_t; typedef __u32 uint32_t; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \ + (!defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)) typedef __u64 uint64_t; typedef __u64 u_int64_t; typedef __s64 int64_t; @@ -112,6 +113,12 @@ typedef __s64 int64_t; #endif /* __KERNEL_STRICT_NAMES */ +#if defined(CONFIG_USE_STDINT) && defined(__INT64_TYPE__) +typedef __UINT64_TYPE__ uint64_t; +typedef __UINT64_TYPE__ u_int64_t; +typedef __INT64_TYPE__ int64_t; +#endif + /* * Below are truly Linux-specific types that should never collide with * any application/library that wants linux/types.h. |