summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-20 21:01:22 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-20 21:01:22 +0100
commitb09aaa1e6d3b75d9eeb65a32dc141ca2b0be6022 (patch)
treec9bd4ff04b4a080921e9671acdeb0e450df14a13
parentdeee3d3f6939b9e0ffa24a4a9bce8bfa5390db39 (diff)
stdint.h: Next attempt at making this work with various compilers
Newer GCC with GNU LIBC do not like our minimalistic version of stdint.h and will have conflicts. Older GCC with older C Libs do not have a stdint.h yet and the #include_next trick is failing. To make matters worse NEWLIB does not export its version via the pre-processor. We will have to guess once more about the compiler. This code now assumes that if we have a GCC < 4 that it does not have a stdint.h and we will not try to include the next stdint.h file.
-rw-r--r--src/target/firmware/include/stdint.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/target/firmware/include/stdint.h b/src/target/firmware/include/stdint.h
index 96907992..627403f9 100644
--- a/src/target/firmware/include/stdint.h
+++ b/src/target/firmware/include/stdint.h
@@ -10,7 +10,14 @@
header file and then check if it has defined int8_t and
if not we will use our own typedefs */
+/* another bad criteria. We can not detect __NEWLIB_H__ or
+ _NEWLIB_VERSION. Assume that older GCCs have a older C library
+ that did not include a stdint.h yet. This is for gnuarm-3.x
+ one of the compilers producing working code right now. */
+
+#if __GNUC__ > 3
#include_next <stdint.h>
+#endif
#ifndef __int8_t_defined
typedef signed char int8_t;