From eafc34b58b7e4298611aa4550a6daf9675fcca3d Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 26 Oct 2004 17:11:03 +0000 Subject: 2004-10-26 Ralf Corsepius * libcsupport/include/rtems/_inttypes.h: Undefine __PRIN defines. * libcsupport/include/rtems/_stdint.h: Apply GNUC-limits to GCC >= 3.3, only. Add _rtems_*_t_defined defines. Add extern "C". --- cpukit/ChangeLog | 6 ++++++ cpukit/libcsupport/include/rtems/_inttypes.h | 7 +++++++ cpukit/libcsupport/include/rtems/_stdint.h | 23 ++++++++++++++++++++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index e69b88dc9d..304e0c449b 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2004-10-26 Ralf Corsepius + + * libcsupport/include/rtems/_inttypes.h: Undefine __PRIN defines. + * libcsupport/include/rtems/_stdint.h: Apply GNUC-limits to GCC >= 3.3, only. + Add _rtems_*_t_defined defines. Add extern "C". + 2004-10-26 Ralf Corsepius * libcsupport/include/rtems/_stdint.h: New. diff --git a/cpukit/libcsupport/include/rtems/_inttypes.h b/cpukit/libcsupport/include/rtems/_inttypes.h index b9167e9f95..f74105470b 100644 --- a/cpukit/libcsupport/include/rtems/_inttypes.h +++ b/cpukit/libcsupport/include/rtems/_inttypes.h @@ -26,6 +26,7 @@ #define PRIx8 __PRI8(x) #define PRIX8 __PRI8(X) +#undef __PRI8 /* 16-bit types */ #define __PRI16(x) __STRINGIFY(x) @@ -37,6 +38,8 @@ #define PRIx16 __PRI16(x) #define PRIX16 __PRI16(X) +#undef __PRI16 + /* 32-bit types */ #if defined(__rtems_long32) #define __PRI32(x) __STRINGIFY(l##x) @@ -51,6 +54,7 @@ #define PRIx32 __PRI32(x) #define PRIX32 __PRI32(X) +#undef __PRI32 /* 64-bit types */ #if defined(__rtems_longlong64) @@ -68,4 +72,7 @@ #define PRIx64 __PRI64(x) #define PRIX64 __PRI64(X) +#undef __STRINGIFY +#undef __PRI64 + #endif /* __rtems__inttypes_h */ diff --git a/cpukit/libcsupport/include/rtems/_stdint.h b/cpukit/libcsupport/include/rtems/_stdint.h index 8f2fc180b5..70705055d8 100644 --- a/cpukit/libcsupport/include/rtems/_stdint.h +++ b/cpukit/libcsupport/include/rtems/_stdint.h @@ -12,7 +12,12 @@ #ifndef __rtems__stdint_h #define __rtems__stdint_h -#ifdef __GNUC__ +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__GNUC__) && (__GNUC__ >= 3 ) \ + && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ) #define __EXP(x) __##x##__ #else #define __EXP(x) x @@ -22,50 +27,62 @@ #if __EXP(SCHAR_MAX) == 0x7f typedef signed char __rtems_int8_t ; typedef unsigned char __rtems_uint8_t ; +#define __rtems_int8_t_defined 1 #endif #if __EXP(INT_MAX) == 0x7fff typedef signed int __rtems_int16_t; typedef unsigned int __rtems_uint16_t; +#define __rtems_int16_t_defined 1 #elif __EXP(SHRT_MAX) == 0x7fff typedef signed short __rtems_int16_t; typedef unsigned short __rtems_uint16_t; +#define __rtems_int16_t_defined 1 #elif __EXP(SCHAR_MAX) == 0x7fff typedef signed char __rtems_int32_t; typedef unsigned char __rtems_uint32_t; +#define __rtems_int16_t_defined 1 #endif #if __EXP(INT_MAX) == 0x7fffffff typedef signed int __rtems_int32_t; typedef unsigned int __rtems_uint32_t; +#define __rtems_int32_t_defined 1 #elif __EXP(LONG_MAX) == 0x7fffffff typedef signed long __rtems_int32_t; typedef unsigned long __rtems_uint32_t; +#define __rtems_int32_t_defined 1 #define __rtems_long32 1 #elif __EXP(SHRT_MAX) == 0x7fffffff typedef signed short __rtems_int32_t; typedef unsigned short __rtems_uint32_t; +#define __rtems_int32_t_defined 1 #elif __EXP(SCHAR_MAX) == 0x7fffffff typedef signed char __rtems_int32_t; typedef unsigned char __rtems_uint32_t; +#define __rtems_int32_t_defined 1 #endif #if __EXP(LONG_MAX) == 0x7fffffffffffffff typedef signed long int __rtems_int64_t; typedef unsigned long int __rtems_uint64_t; +#define __rtems_int64_t_defined 1 #define __rtems_long64 1 #elif __EXP(LONG_LONG_MAX) == 0x7fffffffffffffff typedef signed long int __rtems_int64_t; typedef unsigned long int __rtems_uint64_t; +#define __rtems_int64_t_defined 1 #define __rtems_longlong64 1 #elif __EXP(INT_MAX) == 0x7fffffffffffffff typedef signed int __rtems_int64_t; typedef unsigned int __rtems_uint64_t; +#define __rtems_int64_t_defined 1 #endif #undef __EXP -typedef signed long intptr_t; -typedef unsigned long uintptr_t; +#ifdef __cplusplus +} +#endif #endif /* __rtems__stdint_h */ -- cgit v1.2.3