unix-time 0.1.8 → 0.1.9
raw patch · 3 files changed
+7/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/UnixTime/Sys.hsc +4/−5
- cbits/conv.c +2/−1
- unix-time.cabal +1/−1
Data/UnixTime/Sys.hsc view
@@ -18,15 +18,14 @@ type CTimeZone = () foreign import ccall unsafe "gettimeofday"- gettimeofday :: Ptr CTimeVal -> Ptr CTimeZone -> IO CInt+ c_gettimeofday :: Ptr CTimeVal -> Ptr CTimeZone -> IO CInt -- | -- Getting 'UnixTime' from OS. getUnixTime :: IO UnixTime-getUnixTime =- allocaBytes (#const sizeof(struct timeval)) $ \ p_timeval -> do- throwErrnoIfMinus1_ "getClockTime" $ gettimeofday p_timeval nullPtr- sec <- (#peek struct timeval,tv_sec) p_timeval+getUnixTime = allocaBytes (#const sizeof(struct timeval)) $ \ p_timeval -> do+ throwErrnoIfMinus1_ "getClockTime" $ c_gettimeofday p_timeval nullPtr+ sec <- (#peek struct timeval,tv_sec) p_timeval usec <- (#peek struct timeval,tv_usec) p_timeval return $ UnixTime sec usec
cbits/conv.c view
@@ -7,6 +7,7 @@ #define _BSD_SOURCE #elif HAVE_STRPTIME_L #define THREAD_SAFE 1+#define _GNU_SOURCE #else #define THREAD_SAFE 0 #endif@@ -21,7 +22,7 @@ locale_t c_locale = NULL; void init_locale() {- if (c_locale == NULL) c_locale = newlocale(LC_TIME_MASK, NULL, NULL);+ if (c_locale == NULL) c_locale = newlocale(LC_TIME_MASK, "C", NULL); } #else void init_locale() {
unix-time.cabal view
@@ -1,5 +1,5 @@ Name: unix-time-Version: 0.1.8+Version: 0.1.9 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3