projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2005-02-18 15:06:45 by simonmar]
[ghc-base.git]
/
System
/
Time.hsc
diff --git
a/System/Time.hsc
b/System/Time.hsc
index
ec1c2b8
..
b4a623e
100644
(file)
--- a/
System/Time.hsc
+++ b/
System/Time.hsc
@@
-353,10
+353,10
@@
gmtoff x = (#peek struct tm,tm_gmtoff) x
#else /* ! HAVE_TM_ZONE */
# if HAVE_TZNAME || defined(_WIN32)
#else /* ! HAVE_TM_ZONE */
# if HAVE_TZNAME || defined(_WIN32)
-# if cygwin32_TARGET_OS
+# if cygwin32_HOST_OS
# define tzname _tzname
# endif
# define tzname _tzname
# endif
-# ifndef mingw32_TARGET_OS
+# ifndef mingw32_HOST_OS
foreign import ccall unsafe "time.h &tzname" tzname :: Ptr (Ptr CChar)
# else
foreign import ccall unsafe "__hscore_timezone" timezone :: Ptr CLong
foreign import ccall unsafe "time.h &tzname" tzname :: Ptr (Ptr CChar)
# else
foreign import ccall unsafe "__hscore_timezone" timezone :: Ptr CLong
@@
-377,10
+377,11
@@
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
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 */
# else /* ! HAVE_DECL_ALTZONE */
-#if !defined(mingw32_TARGET_OS)
+#if !defined(mingw32_HOST_OS)
foreign import ccall "time.h &timezone" timezone :: Ptr CLong
#endif
foreign import ccall "time.h &timezone" timezone :: Ptr CLong
#endif
@@
-642,7
+643,6
@@
show2' x
where x' = x `rem` 100
show3 x = show (x `quot` 100) ++ show2 (x `rem` 100)
where x' = x `rem` 100
show3 x = show (x `quot` 100) ++ show2 (x `rem` 100)
- where x' = x `rem` 1000
to12 :: Int -> Int
to12 h = let h' = h `mod` 12 in if h' == 0 then 12 else h'
to12 :: Int -> Int
to12 h = let h' = h `mod` 12 in if h' == 0 then 12 else h'
@@
-744,7
+744,7
@@
foreign import ccall unsafe "time.h gettimeofday"
#if HAVE_FTIME
type CTimeB = ()
#if HAVE_FTIME
type CTimeB = ()
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
foreign import ccall unsafe "time.h ftime" ftime :: Ptr CTimeB -> IO CInt
#else
foreign import ccall unsafe "time.h ftime" ftime :: Ptr CTimeB -> IO ()
foreign import ccall unsafe "time.h ftime" ftime :: Ptr CTimeB -> IO CInt
#else
foreign import ccall unsafe "time.h ftime" ftime :: Ptr CTimeB -> IO ()