From: jjohnstn Date: Tue, 20 Aug 2002 01:40:38 +0000 (+0000) Subject: 2002-08-19 Jeff Johnston X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=17e15df23e3796c427a99fd64dd18bb802a7aa31;p=pf3gnuchains%2Fsourceware.git 2002-08-19 Jeff Johnston * libc/include/sys/types.h: Support __need_inttypes macro that only sets the __intxx and __uintxx types. * libc/machine/powerpc/Makefile.am: Add stdlib to include directories to get mprec.h. * libc/machine/powerpc/Makefile.in: Regenerated. * libc/machine/powerpc/vfprintf.c: Fix state variable type. * libc/machine/powerpc/vfscanf.c: Fix state variable type. Remove redundant fixed-point conversion prototypes. * libc/machine/powerpc/machine/stdlib.h[__SPE__]: Include after setting __need_inttypes. --- diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 9e345cc346..afe225f369 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,16 @@ +2002-08-19 Jeff Johnston + + * libc/include/sys/types.h: Support __need_inttypes macro + that only sets the __intxx and __uintxx types. + * libc/machine/powerpc/Makefile.am: Add stdlib to include directories + to get mprec.h. + * libc/machine/powerpc/Makefile.in: Regenerated. + * libc/machine/powerpc/vfprintf.c: Fix state variable type. + * libc/machine/powerpc/vfscanf.c: Fix state variable type. Remove + redundant fixed-point conversion prototypes. + * libc/machine/powerpc/machine/stdlib.h[__SPE__]: Include + after setting __need_inttypes. + 2002-08-18 Christopher Faylor * libc/include/sys/unistd.h: Add getsid declaration for cygwin. diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index c562a23b4b..78b3f552bd 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -16,9 +16,34 @@ */ #ifndef _SYS_TYPES_H -#define _SYS_TYPES_H #include <_ansi.h> + +#ifndef __INTTYPES_DEFINED__ +#define __INTTYPES_DEFINED__ +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 +#endif /* ! __INTTYPES_DEFINED */ + +#ifndef __need_inttypes + +#define _SYS_TYPES_H #include #if defined (_WIN32) || defined (__CYGWIN__) @@ -100,24 +125,6 @@ typedef unsigned short ino_t; #endif #endif -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 #ifdef __MS_types__ typedef unsigned long vm_offset_t; @@ -360,4 +367,8 @@ typedef struct { #endif /* defined(__rtems__) */ +#endif /* !__need_inttypes */ + +#undef __need_inttypes + #endif /* _SYS_TYPES_H */ diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am index 94962c73c9..917f79e8ec 100644 --- a/newlib/libc/machine/powerpc/Makefile.am +++ b/newlib/libc/machine/powerpc/Makefile.am @@ -12,7 +12,7 @@ EXTRA_lib_a_SOURCES = @extra_sources@ lib_a_DEPENDENCIES = @extra_objs@ ACLOCAL_AMFLAGS = -I ../../.. -AM_CFLAGS = -I $(srcdir)/../../stdio +AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host VEC_MALLOC_COMPILE = $(COMPILE) -DINTERNAL_NEWLIB diff --git a/newlib/libc/machine/powerpc/Makefile.in b/newlib/libc/machine/powerpc/Makefile.in index bb9a15b9c0..5da27f71ea 100644 --- a/newlib/libc/machine/powerpc/Makefile.in +++ b/newlib/libc/machine/powerpc/Makefile.in @@ -97,7 +97,7 @@ EXTRA_lib_a_SOURCES = @extra_sources@ lib_a_DEPENDENCIES = @extra_objs@ ACLOCAL_AMFLAGS = -I ../../.. -AM_CFLAGS = -I $(srcdir)/../../stdio +AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host VEC_MALLOC_COMPILE = $(COMPILE) -DINTERNAL_NEWLIB diff --git a/newlib/libc/machine/powerpc/machine/stdlib.h b/newlib/libc/machine/powerpc/machine/stdlib.h index 45173dac55..03a5319fd8 100644 --- a/newlib/libc/machine/powerpc/machine/stdlib.h +++ b/newlib/libc/machine/powerpc/machine/stdlib.h @@ -18,6 +18,9 @@ _PTR _EXFUN(_vec_realloc_r,(struct _reent *, _PTR __r, size_t __size)); # if defined(__SPE__) +#define __need_inttypes +#include + __int16_t _EXFUN(atosfix16,(const char *__str)); __int16_t _EXFUN(_atosfix16_r,(struct _reent *, const char *__str)); __int32_t _EXFUN(atosfix32,(const char *__str)); diff --git a/newlib/libc/machine/powerpc/vfprintf.c b/newlib/libc/machine/powerpc/vfprintf.c index ff3a4f66b5..8204617800 100644 --- a/newlib/libc/machine/powerpc/vfprintf.c +++ b/newlib/libc/machine/powerpc/vfprintf.c @@ -166,7 +166,6 @@ static char *rcsid = "$Id$"; #include #include #include -#include #include #ifdef __ALTIVEC__ #include @@ -389,7 +388,7 @@ _DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap), int vec_print_count; /* number of vector chunks remaining */ vec_16_byte_union vec_tmp; #endif /* __ALTIVEC__ */ - mbstate_t state; /* mbtowc calls from library must not change state */ + int state; /* mbtowc calls from library must not change state */ /* * Choose PADSIZE to trade efficiency vs. size. If larger printf diff --git a/newlib/libc/machine/powerpc/vfscanf.c b/newlib/libc/machine/powerpc/vfscanf.c index 9cfb658ca1..323a438954 100644 --- a/newlib/libc/machine/powerpc/vfscanf.c +++ b/newlib/libc/machine/powerpc/vfscanf.c @@ -107,7 +107,6 @@ Supporting OS subroutines required: #include #include #include -#include #include #ifdef _HAVE_STDC #include @@ -132,11 +131,6 @@ Supporting OS subroutines required: extern _LONG_DOUBLE _strtold _PARAMS((char *s, char **sptr)); #endif -#ifdef __SPE__ -extern __int64_t _strtosfix64_r _PARAMS((struct _reent *, char *s, char **sptr)); -extern __uint64_t _strtoufix64_r _PARAMS((struct _reent *, char *s, char **sptr)); -#endif - #define _NO_LONGLONG #if defined WANT_PRINTF_LONG_LONG && defined __GNUC__ # undef _NO_LONGLONG @@ -284,7 +278,7 @@ __svfscanf_r (rptr, fp, fmt0, ap) vec_union vec_buf; char *lptr; /* literal pointer */ #ifdef MB_CAPABLE - mbstate_t state; /* value to keep track of multibyte state */ + int state; /* value to keep track of multibyte state */ #endif char *ch_dest;