From 9224ac02ef41b932a460edede965e4f3672f98de Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 21 Dec 2006 12:35:39 +0000 Subject: merged rev2831 from dvipdfmx into xdvipdfmx git-svn-id: svn://tug.org/texlive/trunk@2836 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/xdvipdfmx/src/pdfdoc.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Build/source/texk/xdvipdfmx/src/pdfdoc.c b/Build/source/texk/xdvipdfmx/src/pdfdoc.c index 1a18c7beb74..87c4edf3ec6 100644 --- a/Build/source/texk/xdvipdfmx/src/pdfdoc.c +++ b/Build/source/texk/xdvipdfmx/src/pdfdoc.c @@ -484,6 +484,23 @@ pdf_doc_set_eop_content (const char *content, unsigned length) return; } +/* auxiliary function to compute timezone offset on + systems that do not support the tm_gmtoff in struct tm, + or have a timezone variable. Such as i386-solaris. */ + +static long +compute_timezone_offset() +{ + const time_t now = time(NULL); + struct tm tm; + struct tm local; + time_t gmtoff; + + localtime_r(&now, &local); + gmtime_r(&now, &tm); + return (mktime(&local) - mktime(&tm)); +} + /* * Docinfo */ @@ -494,7 +511,7 @@ asn_date (char *date_string) # ifdef HAVE_TM_GMTOFF # define timezone (-bd_time->tm_gmtoff) # else -# define timezone 0l +# define timezone (-compute_timezone_offset()) # endif /* not HAVE_TM_GMTOFF */ #endif /* not HAVE_TIMEZONE */ time_t current_time; -- cgit v1.2.3