diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2001-08-29 19:47:43 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2001-08-29 19:47:43 +0000 |
commit | 9e2a4ef876d6a0749af136d08e334adfec01f906 (patch) | |
tree | 1fb49e158ae00835d03195684ad3a04e1932ee61 /newlib | |
parent | 3ab7340b9408983fb49bb7addd24b92a08eb3787 (diff) | |
download | newlib-9e2a4ef876d6a0749af136d08e334adfec01f906.zip newlib-9e2a4ef876d6a0749af136d08e334adfec01f906.tar.gz newlib-9e2a4ef876d6a0749af136d08e334adfec01f906.tar.bz2 |
2001-08-29 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h: Add include of <sys/_types.h>.
No longer include time.h. Add struct __tm to use for
_localtime_buf in the reentrant structure. Add a
_NULL definition to use in initializing the reentrant struct.
* libc/include/sys/config.h: For CYGWIN32 and RTEMS, change
the _READ_WRITE_RETURN_TYPE to _ssize_t which is found in
<sys/_types.h>.
* libc/include/sys/unistd.h: Include <sys/_types.h>.
* libc/time/lcltime.c (localtime): Cast the reentrant struct
_localtime_buf to be struct tm *.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 13 | ||||
-rw-r--r-- | newlib/libc/include/sys/config.h | 4 | ||||
-rw-r--r-- | newlib/libc/include/sys/reent.h | 22 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 1 | ||||
-rw-r--r-- | newlib/libc/time/lcltime.c | 2 |
5 files changed, 36 insertions, 6 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index b525505..a14669c 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,16 @@ +2001-08-29 Jeff Johnston <jjohnstn@redhat.com> + + * libc/include/sys/reent.h: Add include of <sys/_types.h>. + No longer include time.h. Add struct __tm to use for + _localtime_buf in the reentrant structure. Add a + _NULL definition to use in initializing the reentrant struct. + * libc/include/sys/config.h: For CYGWIN32 and RTEMS, change + the _READ_WRITE_RETURN_TYPE to _ssize_t which is found in + <sys/_types.h>. + * libc/include/sys/unistd.h: Include <sys/_types.h>. + * libc/time/lcltime.c (localtime): Cast the reentrant struct + _localtime_buf to be struct tm *. + Wed Aug 29 14:17:38 2001 J"orn Rennecke <amylaar@redhat.com> * configure.host (h8300-*-elf*, h8500-*-elf*): New cases. diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index 74860b8..683e5be 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -128,7 +128,7 @@ typedef unsigned int __uint32_t; #if defined(__CYGWIN32__) || defined(__CYGWIN__) #define __FILENAME_MAX__ (260 - 1 /* NUL */) -#define _READ_WRITE_RETURN_TYPE ssize_t +#define _READ_WRITE_RETURN_TYPE _ssize_t #if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) #define __IMPORT #else @@ -138,7 +138,7 @@ typedef unsigned int __uint32_t; #if defined(__rtems__) #define __FILENAME_MAX__ 255 -#define _READ_WRITE_RETURN_TYPE ssize_t +#define _READ_WRITE_RETURN_TYPE _ssize_t #endif #ifndef __IMPORT diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 7aae3f4..65417f8 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -11,7 +11,7 @@ extern "C" { #define _SYS_REENT_H_ #include <_ansi.h> -#include <time.h> +#include <sys/_types.h> #ifndef __Long #if __LONG_MAX__ == 2147483647L @@ -42,6 +42,20 @@ struct _Bigint __ULong _x[1]; }; +/* needed by reentrant structure */ +struct __tm +{ + int __tm_sec; + int __tm_min; + int __tm_hour; + int __tm_mday; + int __tm_mon; + int __tm_year; + int __tm_wday; + int __tm_yday; + int __tm_isdst; +}; + /* * atexit() support */ @@ -208,7 +222,7 @@ struct _reent unsigned int _unused_rand; char * _strtok_last; char _asctime_buf[26]; - struct tm _localtime_buf; + struct __tm _localtime_buf; int _gamma_signgam; __extension__ unsigned long long _rand_next; struct _rand48 _r48; @@ -238,9 +252,11 @@ struct _reent struct __sFILE __sf[3]; /* first three file descriptors */ }; +#define _NULL 0 + #define _REENT_INIT(var) \ { 0, &var.__sf[0], &var.__sf[1], &var.__sf[2], 0, "", 0, "C", \ - 0, NULL, NULL, 0, NULL, NULL, 0, NULL, { {0, NULL, "", \ + 0, _NULL, _NULL, 0, _NULL, _NULL, 0, _NULL, { {0, _NULL, "", \ { 0,0,0,0,0,0,0,0}, 0, 1, \ {{_RAND48_SEED_0, _RAND48_SEED_1, _RAND48_SEED_2}, \ {_RAND48_MULT_0, _RAND48_MULT_1, _RAND48_MULT_2}, _RAND48_ADD}} } } diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index e80c942..efd8ebb 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -7,6 +7,7 @@ extern "C" { #include <_ansi.h> #include <sys/types.h> +#include <sys/_types.h> #define __need_size_t #define __need_ptrdiff_t #include <stddef.h> diff --git a/newlib/libc/time/lcltime.c b/newlib/libc/time/lcltime.c index d4c7d7d..e54a49d 100644 --- a/newlib/libc/time/lcltime.c +++ b/newlib/libc/time/lcltime.c @@ -51,7 +51,7 @@ struct tm * _DEFUN (localtime, (tim_p), _CONST time_t * tim_p) { - return localtime_r (tim_p, &(_REENT->_new._reent._localtime_buf)); + return localtime_r (tim_p, (struct tm *)&(_REENT->_new._reent._localtime_buf)); } #endif |