From 07be216aabff46148510557d1ce6cef470a2a002 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 5 Mar 2014 12:43:12 +0000 Subject: [PATCH] * libc/include/time.h (__TM_GMTOFF): Define on Cygwin. (__TM_ZONE): Ditto. (struct tm): Add __TM_GMTOFF and __TM_ZONE members if they are defined. --- newlib/ChangeLog | 6 ++++++ newlib/libc/include/time.h | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 2b06b4e75..cec4ec598 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2014-03-05 Corinna Vinschen + + * libc/include/time.h (__TM_GMTOFF): Define on Cygwin. + (__TM_ZONE): Ditto. + (struct tm): Add __TM_GMTOFF and __TM_ZONE members if they are defined. + 2014-03-04 Ed Nelson * libc/include/machine/_default_types.h: Define unsigned type using diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index b91b03920..dcae828f5 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -28,6 +28,16 @@ _BEGIN_STD_C +#ifdef __CYGWIN__ +# ifdef __BSD_VISIBLE +# define __TM_GMTOFF tm_gmtoff +# define __TM_ZONE tm_zone +# else +# define __TM_GMTOFF __tm_gmtoff +# define __TM_ZONE __tm_zone +# endif +#endif + struct tm { int tm_sec; @@ -39,6 +49,12 @@ struct tm int tm_wday; int tm_yday; int tm_isdst; +#ifdef __TM_GMTOFF + long __TM_GMTOFF; +#endif +#ifdef __TM_ZONE + const char *__TM_ZONE; +#endif }; clock_t _EXFUN(clock, (void));