diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-11-26 16:26:06 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-11-26 16:26:06 +0000 |
commit | 7b2d80eb87819b8f5183016059c8034b63a94295 (patch) | |
tree | fad0795f13875758c36cfc260b7ad6457b69908f /newlib | |
parent | 5ab123f4aa7cb23e78bc20b6a90bd14298949cd0 (diff) | |
download | newlib-7b2d80eb87819b8f5183016059c8034b63a94295.zip newlib-7b2d80eb87819b8f5183016059c8034b63a94295.tar.gz newlib-7b2d80eb87819b8f5183016059c8034b63a94295.tar.bz2 |
* libc/include/inttypes.h: Add and use __INTTYPES_EXP().
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 4 | ||||
-rw-r--r-- | newlib/libc/include/inttypes.h | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 17555a6..0faa9ab 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2012-11-26 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * libc/include/inttypes.h: Add and use __INTTYPES_EXP(). + 2012-11-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * libm/machine/aarch64/configure.in: Change comment to say libm diff --git a/newlib/libc/include/inttypes.h b/newlib/libc/include/inttypes.h index f3943cb..1631e21 100644 --- a/newlib/libc/include/inttypes.h +++ b/newlib/libc/include/inttypes.h @@ -13,10 +13,20 @@ #ifndef _INTTYPES_H #define _INTTYPES_H +#include <sys/features.h> #include <stdint.h> #define __need_wchar_t #include <stddef.h> +/* Don't use __STDINT_EXP test since GCC's stdint.h provides different + macros than newlib's stdint.h. */ +#if __GNUC_PREREQ(3, 2) + #define __INTTYPES_EXP(x) __##x##__ +#else + #define __INTTYPES_EXP(x) x + #include <limits.h> +#endif + #define __STRINGIFY(a) #a /* 8-bit types */ @@ -242,10 +252,10 @@ #define SCNxMAX __SCNMAX(x) /* ptr types */ -#if PTRDIFF_MAX <= __STDINT_EXP(INT_MAX) +#if PTRDIFF_MAX <= __INTTYPES_EXP(INT_MAX) # define __PRIPTR(x) __STRINGIFY(x) # define __SCNPTR(x) __STRINGIFY(x) -#elif PTRDIFF_MAX <= __STDINT_EXP(LONG_MAX) || !defined(__have_longlong64) +#elif PTRDIFF_MAX <= __INTTYPES_EXP(LONG_MAX) || !defined(__have_longlong64) # define __PRIPTR(x) __STRINGIFY(l##x) # define __SCNPTR(x) __STRINGIFY(l##x) #else |