From: ross Date: Thu, 28 Jul 2005 13:27:03 +0000 (+0000) Subject: [project @ 2005-07-28 13:27:03 by ross] X-Git-Tag: cmm-merge2~37 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=4d02aaffbca61222dac9718f7d1873c2a0bd9019;p=ghc-base.git [project @ 2005-07-28 13:27:03 by ross] avoid warnings --- diff --git a/System/Time.hsc b/System/Time.hsc index 74293ee..d7ae3f5 100644 --- a/System/Time.hsc +++ b/System/Time.hsc @@ -455,13 +455,16 @@ throwAwayReturnPointer :: (Ptr CTime -> Ptr CTm -> IO (Ptr CTm)) -> (Ptr CTime -> Ptr CTm -> IO ( )) throwAwayReturnPointer fun x y = fun x y >> return () +#if !HAVE_LOCALTIME_R || !HAVE_GMTIME_R clockToCalendarTime_static :: (Ptr CTime -> IO (Ptr CTm)) -> Bool -> ClockTime -> IO CalendarTime clockToCalendarTime_static fun is_utc (TOD secs psec) = do with (fromIntegral secs :: CTime) $ \ p_timer -> do p_tm <- fun p_timer -- can't fail, according to POSIX clockToCalendarTime_aux is_utc p_tm psec +#endif +#if HAVE_LOCALTIME_R || HAVE_GMTIME_R clockToCalendarTime_reentrant :: (Ptr CTime -> Ptr CTm -> IO ()) -> Bool -> ClockTime -> IO CalendarTime clockToCalendarTime_reentrant fun is_utc (TOD secs psec) = do @@ -469,6 +472,7 @@ clockToCalendarTime_reentrant fun is_utc (TOD secs psec) = do allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do fun p_timer p_tm clockToCalendarTime_aux is_utc p_tm psec +#endif clockToCalendarTime_aux :: Bool -> Ptr CTm -> Integer -> IO CalendarTime clockToCalendarTime_aux is_utc p_tm psec = do @@ -733,21 +737,19 @@ foreign import ccall unsafe "time.h gmtime" #endif foreign import ccall unsafe "time.h mktime" mktime :: Ptr CTm -> IO CTime -foreign import ccall unsafe "time.h time" - time :: Ptr CTime -> IO CTime #if HAVE_GETTIMEOFDAY type CTimeVal = () foreign import ccall unsafe "time.h gettimeofday" gettimeofday :: Ptr CTimeVal -> Ptr () -> IO CInt -#endif - -#if HAVE_FTIME +#elif HAVE_FTIME type CTimeB = () #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 () #endif +#else +foreign import ccall unsafe "time.h time" time :: Ptr CTime -> IO CTime #endif #endif /* ! __HUGS__ */