summaryrefslogtreecommitdiffstats
path: root/include/compiler.h
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2014-10-15 04:38:30 -0600
committerTom Rini <trini@ti.com>2014-10-27 11:04:01 -0400
commit0d296cc2d3b8e2ffa46b4a93d1398fa6bf85b504 (patch)
tree25c0cadf3c5056cbe0c72ab19c932293428b5615 /include/compiler.h
parent4bf3a56f2b2c7c7bbf3825484d361d564a270783 (diff)
downloadblackbird-obmc-uboot-0d296cc2d3b8e2ffa46b4a93d1398fa6bf85b504.tar.gz
blackbird-obmc-uboot-0d296cc2d3b8e2ffa46b4a93d1398fa6bf85b504.zip
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/compiler.h')
-rw-r--r--include/compiler.h11
1 files changed, 8 insertions, 3 deletions
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 <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)
OpenPOWER on IntegriCloud