diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-09-07 21:16:25 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-09-07 21:16:25 +0000 |
commit | dde223343c2cd08f4ac1973134dc9a409a6829f2 (patch) | |
tree | b465a7cb6a512790f2ef80ca4ca458f12e3f4622 /newlib/libc | |
parent | 78e66fb978b25652c87319063d984bd6e80e6f44 (diff) | |
download | cygnal-dde223343c2cd08f4ac1973134dc9a409a6829f2.tar.gz cygnal-dde223343c2cd08f4ac1973134dc9a409a6829f2.tar.bz2 cygnal-dde223343c2cd08f4ac1973134dc9a409a6829f2.zip |
2007-09-07 Patrick Mansfield <patmans@us.ibm.com>
* libc/include/machine/_default_types.h: New file, contains what
was previously in libc/include/machine/_types.h.
* libc/include/machine/_types.h: Now only includes
machine/_default_types.h.
* libc/include/sys/reent.h: Remove _fpos_t and _fpos64_t.
* libc/include/sys/_types.h: Move _fpos_t and _fpos64_t to here,
with conditional declarations.
* libc/machine/spu/machine/_types.h: New file, add SPU specific
typedefs for _fpos_t and _fpos64_t.
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/include/machine/_default_types.h | 121 | ||||
-rw-r--r-- | newlib/libc/include/machine/_types.h | 115 | ||||
-rw-r--r-- | newlib/libc/include/sys/_types.h | 16 | ||||
-rw-r--r-- | newlib/libc/include/sys/reent.h | 12 | ||||
-rw-r--r-- | newlib/libc/machine/spu/machine/_types.h | 52 |
5 files changed, 190 insertions, 126 deletions
diff --git a/newlib/libc/include/machine/_default_types.h b/newlib/libc/include/machine/_default_types.h new file mode 100644 index 000000000..a20abce84 --- /dev/null +++ b/newlib/libc/include/machine/_default_types.h @@ -0,0 +1,121 @@ +/* + * $Id$ + */ + +#ifndef _MACHINE__DEFAULT_TYPES_H +#define _MACHINE__DEFAULT_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 __<val>__ implicitly defined. */ +#define __EXP(x) __##x##__ +#else +/* Fall back to POSIX versions from <limits.h> */ +#define __EXP(x) x +#include <limits.h> +#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 <limits.h> */ +#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__DEFAULT_TYPES_H */ diff --git a/newlib/libc/include/machine/_types.h b/newlib/libc/include/machine/_types.h index 450ad4a6b..17e6d51e3 100644 --- a/newlib/libc/include/machine/_types.h +++ b/newlib/libc/include/machine/_types.h @@ -4,118 +4,5 @@ #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 __<val>__ implicitly defined. */ -#define __EXP(x) __##x##__ -#else -/* Fall back to POSIX versions from <limits.h> */ -#define __EXP(x) x -#include <limits.h> -#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 +#include <machine/_default_types.h> #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 <limits.h> */ -#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 d3f68cef5..7bb72657d 100644 --- a/newlib/libc/include/sys/_types.h +++ b/newlib/libc/include/sys/_types.h @@ -9,11 +9,27 @@ #ifndef _SYS__TYPES_H #define _SYS__TYPES_H +#include <machine/_types.h> #include <sys/lock.h> typedef long _off_t; __extension__ typedef long long _off64_t; +/* + * We need fpos_t for the following, but it doesn't have a leading "_", + * so we use _fpos_t instead. + */ +#ifndef __FPOS_T_DEFINED +typedef long _fpos_t; /* XXX must match off_t in <sys/types.h> */ + /* (and must be `long' for now) */ +#endif + +#ifdef __LARGE64_FILES +#ifndef __FPOS64_T_DEFINED +typedef _off64_t _fpos64_t; +#endif +#endif + #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 typedef int _ssize_t; #else diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 06d025bb5..39785d77d 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -108,18 +108,6 @@ struct __sbuf { }; /* - * We need fpos_t for the following, but it doesn't have a leading "_", - * so we use _fpos_t instead. - */ - -typedef long _fpos_t; /* XXX must match off_t in <sys/types.h> */ - /* (and must be `long' for now) */ - -#ifdef __LARGE64_FILES -typedef _off64_t _fpos64_t; -#endif - -/* * Stdio state variables. * * The following always hold: diff --git a/newlib/libc/machine/spu/machine/_types.h b/newlib/libc/machine/spu/machine/_types.h new file mode 100644 index 000000000..a3950f5fd --- /dev/null +++ b/newlib/libc/machine/spu/machine/_types.h @@ -0,0 +1,52 @@ +/* + Copyright 2007 + International Business Machines Corporation, + Sony Computer Entertainment, Incorporated, + Toshiba Corporation, + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the names of the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _MACHINE__TYPES_H +#define _MACHINE__TYPES_H + +#include <machine/_default_types.h> + +/* + * fpos_t large enough for either 32 or 64 bit ppc glibc fpos_t. + */ +#define __FPOS_T_DEFINED +typedef struct { + char __pos[16]; +} _fpos_t; + +#ifdef __LARGE64_FILES +#define __FPOS64_T_DEFINED +typedef _fpos_t _fpos64_t; +#endif + +#endif /* _MACHINE__TYPES_H */ |