[project @ 2004-09-10 08:29:14 by stolz]
authorstolz <unknown>
Fri, 10 Sep 2004 08:29:14 +0000 (08:29 +0000)
committerstolz <unknown>
Fri, 10 Sep 2004 08:29:14 +0000 (08:29 +0000)
Fix build on Solaris: CTime is no longer an instance of Integral, so do the
realToInteger-dance.

System/Time.hsc

index ec1c2b8..6b59353 100644 (file)
@@ -377,7 +377,8 @@ 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)
+  let realToInteger = round . realToFrac :: Real a => a -> Integer
+  return (-fromIntegral (realToInteger tz))
 # else /* ! HAVE_DECL_ALTZONE */
 
 #if !defined(mingw32_TARGET_OS)