stdint.h: Next attempt at making this work with various compilers
authorHolger Hans Peter Freyther <zecke@selfish.org>
Mon, 20 Dec 2010 20:01:22 +0000 (21:01 +0100)
committerHolger Hans Peter Freyther <zecke@selfish.org>
Mon, 20 Dec 2010 20:01:22 +0000 (21:01 +0100)
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.

src/target/firmware/include/stdint.h

index 9690799..627403f 100644 (file)
    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;