From 2e7d9bf906c37584962e7d89b6de55c1fec9eeb3 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Sun, 6 Mar 2005 20:32:16 +0000 Subject: 2005-03-06 Ralf Corsepious * libc/include/machine/_types.h: New file. * libc/include/sys/types.h: Do not check for __rtems__ when including . Remove some redundant declarations now that is included. * libc/sys/rtems/machine/_types.h: Removed. Replaced with shared header file. --- newlib/ChangeLog | 9 +++ newlib/libc/include/machine/_types.h | 121 +++++++++++++++++++++++++++++++++ newlib/libc/include/sys/types.h | 24 +------ newlib/libc/sys/rtems/machine/_types.h | 121 --------------------------------- 4 files changed, 132 insertions(+), 143 deletions(-) create mode 100644 newlib/libc/include/machine/_types.h delete mode 100644 newlib/libc/sys/rtems/machine/_types.h (limited to 'newlib') diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f79530c..38707e8 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,12 @@ +2005-03-06 Ralf Corsepious + + * libc/include/machine/_types.h: New file. + * libc/include/sys/types.h: Do not check for __rtems__ + when including . Remove some redundant + declarations now that is included. + * libc/sys/rtems/machine/_types.h: Removed. Replaced with + shared header file. + 2005-02-25 Ralf Corsepious * libm/common/fdlibm.h (FLT_UWORD_MAX, FLT_UWORD_HALF_MAX): Add diff --git a/newlib/libc/include/machine/_types.h b/newlib/libc/include/machine/_types.h new file mode 100644 index 0000000..ab76561 --- /dev/null +++ b/newlib/libc/include/machine/_types.h @@ -0,0 +1,121 @@ +/* + * $Id$ + */ + +#ifndef _MACHINE__TYPES_H +#define _MACHINE__TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Guess on types by examining *_MIN/*_MAX defines. + */ +#if defined(__GNUC__) && (__GNUC__ >= 3 ) \ + && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ) +/* GCC >= 3.3.0 has ____ implicitly defined. */ +#define __EXP(x) __##x##__ +#else +/* Fall back to POSIX versions from */ +#define __EXP(x) x +#include +#endif + +#if __EXP(SCHAR_MAX) == 0x7f +typedef signed char __int8_t ; +typedef unsigned char __uint8_t ; +#define ___int8_t_defined 1 +#endif + +#if __EXP(INT_MAX) == 0x7fff +typedef signed int __int16_t; +typedef unsigned int __uint16_t; +#define ___int16_t_defined 1 +#elif __EXP(SHRT_MAX) == 0x7fff +typedef signed short __int16_t; +typedef unsigned short __uint16_t; +#define ___int16_t_defined 1 +#elif __EXP(SCHAR_MAX) == 0x7fff +typedef signed char __int16_t; +typedef unsigned char __uint16_t; +#define ___int16_t_defined 1 +#endif + +#if ___int16_t_defined +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +#define ___int_least16_t_defined 1 + +#if !___int8_t_defined +typedef __int16_t __int_least8_t; +typedef __uint16_t __uint_least8_t; +#define ___int_least8_t_defined 1 +#endif +#endif + +#if __EXP(INT_MAX) == 0x7fffffffL +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +#define ___int32_t_defined 1 +#elif __EXP(LONG_MAX) == 0x7fffffffL +typedef signed long __int32_t; +typedef unsigned long __uint32_t; +#define ___int32_t_defined 1 +#elif __EXP(SHRT_MAX) == 0x7fffffffL +typedef signed short __int32_t; +typedef unsigned short __uint32_t; +#define ___int32_t_defined 1 +#elif __EXP(SCHAR_MAX) == 0x7fffffffL +typedef signed char __int32_t; +typedef unsigned char __uint32_t; +#define ___int32_t_defined 1 +#endif + +#if ___int32_t_defined +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +#define ___int_least32_t_defined 1 + +#if !___int8_t_defined +typedef __int32_t __int_least8_t; +typedef __uint32_t __uint_least8_t; +#define ___int_least8_t_defined 1 +#endif +#if !___int16_t_defined +typedef __int32_t __int_least16_t; +typedef __uint32_t __uint_least16_t; +#define ___int_least16_t_defined 1 +#endif +#endif + +#if __EXP(LONG_MAX) > 0x7fffffff +typedef signed long __int64_t; +typedef unsigned long __uint64_t; +#define ___int64_t_defined 1 + +/* GCC has __LONG_LONG_MAX__ */ +#elif defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff) +typedef signed long long __int64_t; +typedef unsigned long long __uint64_t; +#define ___int64_t_defined 1 + +/* POSIX mandates LLONG_MAX in */ +#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff) +typedef signed long long __int64_t; +typedef unsigned long long __uint64_t; +#define ___int64_t_defined 1 + +#elif __EXP(INT_MAX) > 0x7fffffff +typedef signed int __int64_t; +typedef unsigned int __uint64_t; +#define ___int64_t_defined 1 +#endif + +#undef __EXP + +#ifdef __cplusplus +} +#endif + +#endif /* _MACHINE__TYPES_H */ diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 9441495..5c288bf 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -22,35 +22,15 @@ #ifndef __INTTYPES_DEFINED__ #define __INTTYPES_DEFINED__ -#if !defined (__rtems__) -typedef short int __int16_t; -typedef unsigned short int __uint16_t; - -#if __INT_MAX__ == 32767 -typedef long int __int32_t; -typedef unsigned long int __uint32_t; -#else -typedef int __int32_t; -typedef unsigned int __uint32_t; -#endif - -#if __LONG_MAX__ > 2147483647 || !defined(__GNUC__) -typedef long int __int64_t; -typedef unsigned long int __uint64_t; -#else -__extension__ typedef long long __int64_t; -__extension__ typedef unsigned long long __uint64_t; -#endif -#else /* __rtems__ */ +#include +#if defined(__rtems__) /* * The following section is RTEMS specific and is needed to more * closely match the types defined in the BSD sys/types.h. * This is needed to let the RTEMS/BSD TCP/IP stack compile. */ -#include - /* deprecated */ #if ___int8_t_defined typedef __uint8_t u_int8_t; diff --git a/newlib/libc/sys/rtems/machine/_types.h b/newlib/libc/sys/rtems/machine/_types.h deleted file mode 100644 index ab76561..0000000 --- a/newlib/libc/sys/rtems/machine/_types.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Id$ - */ - -#ifndef _MACHINE__TYPES_H -#define _MACHINE__TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Guess on types by examining *_MIN/*_MAX defines. - */ -#if defined(__GNUC__) && (__GNUC__ >= 3 ) \ - && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ) -/* GCC >= 3.3.0 has ____ implicitly defined. */ -#define __EXP(x) __##x##__ -#else -/* Fall back to POSIX versions from */ -#define __EXP(x) x -#include -#endif - -#if __EXP(SCHAR_MAX) == 0x7f -typedef signed char __int8_t ; -typedef unsigned char __uint8_t ; -#define ___int8_t_defined 1 -#endif - -#if __EXP(INT_MAX) == 0x7fff -typedef signed int __int16_t; -typedef unsigned int __uint16_t; -#define ___int16_t_defined 1 -#elif __EXP(SHRT_MAX) == 0x7fff -typedef signed short __int16_t; -typedef unsigned short __uint16_t; -#define ___int16_t_defined 1 -#elif __EXP(SCHAR_MAX) == 0x7fff -typedef signed char __int16_t; -typedef unsigned char __uint16_t; -#define ___int16_t_defined 1 -#endif - -#if ___int16_t_defined -typedef __int16_t __int_least16_t; -typedef __uint16_t __uint_least16_t; -#define ___int_least16_t_defined 1 - -#if !___int8_t_defined -typedef __int16_t __int_least8_t; -typedef __uint16_t __uint_least8_t; -#define ___int_least8_t_defined 1 -#endif -#endif - -#if __EXP(INT_MAX) == 0x7fffffffL -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -#define ___int32_t_defined 1 -#elif __EXP(LONG_MAX) == 0x7fffffffL -typedef signed long __int32_t; -typedef unsigned long __uint32_t; -#define ___int32_t_defined 1 -#elif __EXP(SHRT_MAX) == 0x7fffffffL -typedef signed short __int32_t; -typedef unsigned short __uint32_t; -#define ___int32_t_defined 1 -#elif __EXP(SCHAR_MAX) == 0x7fffffffL -typedef signed char __int32_t; -typedef unsigned char __uint32_t; -#define ___int32_t_defined 1 -#endif - -#if ___int32_t_defined -typedef __int32_t __int_least32_t; -typedef __uint32_t __uint_least32_t; -#define ___int_least32_t_defined 1 - -#if !___int8_t_defined -typedef __int32_t __int_least8_t; -typedef __uint32_t __uint_least8_t; -#define ___int_least8_t_defined 1 -#endif -#if !___int16_t_defined -typedef __int32_t __int_least16_t; -typedef __uint32_t __uint_least16_t; -#define ___int_least16_t_defined 1 -#endif -#endif - -#if __EXP(LONG_MAX) > 0x7fffffff -typedef signed long __int64_t; -typedef unsigned long __uint64_t; -#define ___int64_t_defined 1 - -/* GCC has __LONG_LONG_MAX__ */ -#elif defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff) -typedef signed long long __int64_t; -typedef unsigned long long __uint64_t; -#define ___int64_t_defined 1 - -/* POSIX mandates LLONG_MAX in */ -#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff) -typedef signed long long __int64_t; -typedef unsigned long long __uint64_t; -#define ___int64_t_defined 1 - -#elif __EXP(INT_MAX) > 0x7fffffff -typedef signed int __int64_t; -typedef unsigned int __uint64_t; -#define ___int64_t_defined 1 -#endif - -#undef __EXP - -#ifdef __cplusplus -} -#endif - -#endif /* _MACHINE__TYPES_H */ -- cgit v1.1