Update of /cvsroot/gqclient/gq/src
In directory usw-pr-cvs1:/tmp/cvs-serv26058
Modified Files:
dt_time.c
Log Message:
* Use either struct tm and tm_gmtoff or the global timezone variable,
depending on what configure finds out
Index: dt_time.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/dt_time.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dt_time.c 17 Jul 2002 21:46:22 -0000 1.4
--- dt_time.c 11 Oct 2002 13:49:35 -0000 1.5
***************
*** 235,239 ****
--- 235,241 ----
struct tm *l;
gchar *content;
+ #if ! defined(HAVE_TM_GMTOFF) && defined(HAVE_TIMEZONE)
extern long timezone;
+ #endif
time(&t);
***************
*** 244,259 ****
d = l->tm_mday;
ofs_sign = timezone > 0 ? 1 : -1;
ofs_m = (timezone > 0 ? timezone : -timezone) / 60;
! /* printf("ofs_m=%d\n", ofs_m); */
ofs_h = ofs_m / 60;
ofs_m = ofs_m % 60;
! /* printf("ofs_h=%d, ofs_m=%d, isdst=%d\n", ofs_h, ofs_m, l->tm_isdst); */
!
if (l->tm_isdst) {
ofs_h++;
}
/* NOTE: generalizedTime includes offset relative to GMT while
--- 246,277 ----
d = l->tm_mday;
+ #ifdef HAVE_TM_GMTOFF
+ ofs_sign = l->TM_GMTOFF < 0 ? 1 : -1;
+
+ ofs_m = (l->TM_GMTOFF > 0 ? l->TM_GMTOFF : -l->TM_GMTOFF) / 60;
+
+ ofs_h = ofs_m / 60;
+ ofs_m = ofs_m % 60;
+ #else /* HAVE_TM_GMTOFF */
+ # ifdef HAVE_TIMEZONE
ofs_sign = timezone > 0 ? 1 : -1;
ofs_m = (timezone > 0 ? timezone : -timezone) / 60;
!
ofs_h = ofs_m / 60;
ofs_m = ofs_m % 60;
! /* extern long timezone does not take DST into account */
if (l->tm_isdst) {
ofs_h++;
}
+
+ # else /* HAVE_TIMEZONE */
+
+ ofs_h = ofs_m = 0;
+
+ # endif /* HAVE_TIMEZONE */
+ #endif /* HAVE_TM_GMTOFF */
+
/* NOTE: generalizedTime includes offset relative to GMT while
|