aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-12-13 06:54:41 +0800
committerDan Winship <danw@src.gnome.org>2000-12-13 06:54:41 +0800
commit9195d5465ee135ac9451f836d1075bdcd7cac8c2 (patch)
tree70feb020f5f23f9c6d8e10195625de34b51f8f59 /libical/src
parentb03dcd755230c2b6cb896963977f2537ed50b2a4 (diff)
downloadgsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.tar
gsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.tar.gz
gsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.tar.bz2
gsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.tar.lz
gsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.tar.xz
gsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.tar.zst
gsoc2013-evolution-9195d5465ee135ac9451f836d1075bdcd7cac8c2.zip
Add a check for "extern int timezone;" vs struct tm tm_gmtoff, stolen from
* configure.in: Add a check for "extern int timezone;" vs struct tm tm_gmtoff, stolen from Evolution's configure.in. * src/libical/icaltime.c (icaltime_utc_offset, icaltime_local_utc_offset): Use HAVE_TIMEZONE, add tm_gmtoff support. * src/libical/icallexer.l: Remove ical_yy_scan_buffer, ..._string, and ..._bytes prototypes, since it compiles fine without them on Linux, and bombs out due to prototype mismatch on my NetBSD box. svn path=/trunk/; revision=6945
Diffstat (limited to 'libical/src')
-rw-r--r--libical/src/libical/icallexer.l8
-rw-r--r--libical/src/libical/icaltime.c11
2 files changed, 11 insertions, 8 deletions
diff --git a/libical/src/libical/icallexer.l b/libical/src/libical/icallexer.l
index 4ac847b064..5a3616b8da 100644
--- a/libical/src/libical/icallexer.l
+++ b/libical/src/libical/icallexer.l
@@ -6,7 +6,7 @@
DESCRIPTION:
- $Id: icallexer.l,v 1.6 2000/12/12 00:27:39 federico Exp $
+ $Id: icallexer.l,v 1.7 2000/12/12 22:54:40 danw Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
@@ -63,12 +63,6 @@ char *str_buf;
char *str_buf_p;
size_t buf_sz; /* = ICAL_MAX_STR_CONST;*/
-/* Define routines that were not propertly defined because of the
-renaming hack applied in icalyacc.y */
-YY_BUFFER_STATE ical_yy_scan_buffer ( char *base, yy_size_t size );
-YY_BUFFER_STATE ical_yy_scan_string ( yyconst char *yy_str );
-YY_BUFFER_STATE ical_yy_scan_bytes ( yyconst char *bytes, int len );
-
%}
crlf \x0D?\x0A
diff --git a/libical/src/libical/icaltime.c b/libical/src/libical/icaltime.c
index f43602a721..3a762a73f9 100644
--- a/libical/src/libical/icaltime.c
+++ b/libical/src/libical/icaltime.c
@@ -284,7 +284,9 @@ struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid)
indicating the date for which you want the offset */
time_t icaltime_utc_offset(struct icaltimetype tt, const char* tzid)
{
+#ifdef HAVE_TIMEZONE
extern long int timezone;
+#endif
time_t now;
struct tm *stm;
@@ -315,7 +317,11 @@ time_t icaltime_utc_offset(struct icaltimetype tt, const char* tzid)
putenv("TZ"); /* Delete from environment */
}
+#ifdef HAVE_TIMEZONE
return timezone;
+#else
+ return -stm->tm_gmtoff;
+#endif
}
time_t icaltime_local_utc_offset()
@@ -325,8 +331,11 @@ time_t icaltime_local_utc_offset()
stm = localtime(&now); /* This sets 'timezone'*/
+#ifdef HAVE_TIMEZONE
return timezone;
-
+#else
+ return -stm->tm_gmtoff;
+#endif
}