From b09aaa1e6d3b75d9eeb65a32dc141ca2b0be6022 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 20 Dec 2010 21:01:22 +0100 Subject: [PATCH] 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. --- src/target/firmware/include/stdint.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/target/firmware/include/stdint.h b/src/target/firmware/include/stdint.h index 9690799..627403f 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 +#endif #ifndef __int8_t_defined typedef signed char int8_t; -- 2.20.1