From 623fbd5e8ad8fac1d09878130f8945e2e3f2b47c Mon Sep 17 00:00:00 2001 From: panne Date: Mon, 18 Aug 2003 12:46:21 +0000 Subject: [PATCH] [project @ 2003-08-18 12:46:21 by panne] Revamped altzone detection. Note that we test only for successful compilation now, not for successful linking, but this is what most autoconf macros do. --- System/Time.hsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/System/Time.hsc b/System/Time.hsc index b4e0d97..c83e2ef 100644 --- a/System/Time.hsc +++ b/System/Time.hsc @@ -342,14 +342,14 @@ zone x = do # endif /* ! HAVE_TZNAME */ -- Get the offset in secs from UTC, if (struct tm) doesn't supply it. */ -# if HAVE_ALTZONE +# if HAVE_DECL_ALTZONE foreign import ccall "&altzone" altzone :: Ptr CTime foreign import ccall "&timezone" timezone :: Ptr CTime gmtoff x = do dst <- (#peek struct tm,tm_isdst) x tz <- if dst then peek altzone else peek timezone return (-fromIntegral tz) -# else /* ! HAVE_ALTZONE */ +# else /* ! HAVE_DECL_ALTZONE */ #if !defined(mingw32_TARGET_OS) foreign import ccall unsafe "timezone" timezone :: Ptr CLong @@ -366,7 +366,7 @@ gmtoff x = do -- This module assumes the interpretation of tm_gmtoff, i.e., offsets -- are > 0 East of the Prime Meridian, so flip the sign. return (- (if dst then (fromIntegral tz - 3600) else tz)) -# endif /* ! HAVE_ALTZONE */ +# endif /* ! HAVE_DECL_ALTZONE */ #endif /* ! HAVE_TM_ZONE */ #endif /* ! __HUGS__ */ -- 1.7.10.4