X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=System%2FTime.hsc;h=a2c6b5b2494740591f40facf2ca16c79508cd304;hb=a2a70b9bf60672c72b35654105402cf21238b6f4;hp=ff10ffc5ff5038922f2931c17ace025213035273;hpb=feb4623197f214fa7cf1df158f80c5b31d0e59ad;p=haskell-directory.git diff --git a/System/Time.hsc b/System/Time.hsc index ff10ffc..a2c6b5b 100644 --- a/System/Time.hsc +++ b/System/Time.hsc @@ -270,8 +270,8 @@ addToClockTime (TimeDiff year mon day hour min sec psec) 60 * toInteger min + 3600 * toInteger hour + 24 * 3600 * toInteger day - cal = toUTCTime (TOD (c_sec + sec_diff) (c_psec + psec)) - -- FIXME! ^^^^ + (d_sec, d_psec) = (c_psec + psec) `quotRem` 1000000000000 + cal = toUTCTime (TOD (c_sec + sec_diff + d_sec) d_psec) new_mon = fromEnum (ctMonth cal) + r_mon month' = fst tmp yr_diff = snd tmp @@ -357,10 +357,10 @@ gmtoff x = (#peek struct tm,tm_gmtoff) x # define tzname _tzname # endif # ifndef mingw32_HOST_OS -foreign import ccall unsafe "time.h &tzname" tzname :: Ptr (Ptr CChar) +foreign import ccall unsafe "time.h &tzname" tzname :: Ptr CString # else foreign import ccall unsafe "__hscore_timezone" timezone :: Ptr CLong -foreign import ccall unsafe "__hscore_tzname" tzname :: Ptr (Ptr CChar) +foreign import ccall unsafe "__hscore_tzname" tzname :: Ptr CString # endif zone x = do dst <- (#peek struct tm,tm_isdst) x @@ -740,8 +740,9 @@ foreign import ccall unsafe "time.h mktime" #if HAVE_GETTIMEOFDAY type CTimeVal = () +type CTimeZone = () foreign import ccall unsafe "time.h gettimeofday" - gettimeofday :: Ptr CTimeVal -> Ptr () -> IO CInt + gettimeofday :: Ptr CTimeVal -> Ptr CTimeZone -> IO CInt #elif HAVE_FTIME type CTimeB = () #ifndef mingw32_HOST_OS