2014-10-14 04:16:38 +00:00
|
|
|
From 9569708b67df79185dde603f1305eb84d168eba6 Mon Sep 17 00:00:00 2001
|
2013-10-18 20:19:22 +00:00
|
|
|
From: dummy <dummy@example.com>
|
2014-10-14 04:16:38 +00:00
|
|
|
Date: Tue, 14 Oct 2014 01:07:34 +0000
|
2014-07-14 21:58:13 +00:00
|
|
|
Subject: [PATCH] hack for bionic
|
2013-09-23 00:14:48 +00:00
|
|
|
|
|
|
|
---
|
2013-10-18 20:19:22 +00:00
|
|
|
Data/UnixTime/Types.hsc | 12 ------------
|
|
|
|
cbits/conv.c | 2 +-
|
2014-10-14 04:16:38 +00:00
|
|
|
unix-time.cabal | 2 --
|
|
|
|
3 files changed, 1 insertion(+), 15 deletions(-)
|
2013-09-23 00:14:48 +00:00
|
|
|
|
2013-10-18 20:19:22 +00:00
|
|
|
diff --git a/Data/UnixTime/Types.hsc b/Data/UnixTime/Types.hsc
|
2014-10-14 04:16:38 +00:00
|
|
|
index aa64970..ddca145 100644
|
2013-10-18 20:19:22 +00:00
|
|
|
--- a/Data/UnixTime/Types.hsc
|
|
|
|
+++ b/Data/UnixTime/Types.hsc
|
2014-07-14 21:58:13 +00:00
|
|
|
@@ -12,8 +12,6 @@ import Data.Binary
|
2013-10-18 20:19:22 +00:00
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
-#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)
|
|
|
|
-
|
|
|
|
-- |
|
|
|
|
-- Data structure for Unix time.
|
2014-10-14 04:16:38 +00:00
|
|
|
--
|
|
|
|
@@ -33,16 +31,6 @@ data UnixTime = UnixTime {
|
2013-10-18 20:19:22 +00:00
|
|
|
, utMicroSeconds :: {-# UNPACK #-} !Int32
|
|
|
|
} deriving (Eq,Ord,Show)
|
|
|
|
|
|
|
|
-instance Storable UnixTime where
|
|
|
|
- sizeOf _ = (#size struct timeval)
|
|
|
|
- alignment _ = (#alignment struct timeval)
|
|
|
|
- peek ptr = UnixTime
|
|
|
|
- <$> (#peek struct timeval, tv_sec) ptr
|
|
|
|
- <*> (#peek struct timeval, tv_usec) ptr
|
|
|
|
- poke ptr ut = do
|
|
|
|
- (#poke struct timeval, tv_sec) ptr (utSeconds ut)
|
|
|
|
- (#poke struct timeval, tv_usec) ptr (utMicroSeconds ut)
|
|
|
|
-
|
2014-07-14 21:58:13 +00:00
|
|
|
#if __GLASGOW_HASKELL__ >= 704
|
2014-07-03 23:47:49 +00:00
|
|
|
instance Binary UnixTime where
|
|
|
|
put (UnixTime (CTime sec) msec) = do
|
2013-09-23 00:14:48 +00:00
|
|
|
diff --git a/cbits/conv.c b/cbits/conv.c
|
2014-10-14 04:16:38 +00:00
|
|
|
index 669cfda..8fa5f9a 100644
|
2013-09-23 00:14:48 +00:00
|
|
|
--- a/cbits/conv.c
|
|
|
|
+++ b/cbits/conv.c
|
2014-10-14 04:16:38 +00:00
|
|
|
@@ -98,7 +98,7 @@ time_t c_parse_unix_time_gmt(char *fmt, char *src) {
|
2013-09-23 00:14:48 +00:00
|
|
|
#else
|
|
|
|
strptime(src, fmt, &dst);
|
|
|
|
#endif
|
|
|
|
- return timegm(&dst);
|
|
|
|
+ return NULL; /* timegm(&dst); (not in Bionic) */
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t c_format_unix_time(char *fmt, time_t src, char* dst, int siz) {
|
2014-07-14 21:58:13 +00:00
|
|
|
diff --git a/unix-time.cabal b/unix-time.cabal
|
2014-10-14 04:16:38 +00:00
|
|
|
index 1061602..588499a 100644
|
2014-07-14 21:58:13 +00:00
|
|
|
--- a/unix-time.cabal
|
|
|
|
+++ b/unix-time.cabal
|
2014-10-14 04:16:38 +00:00
|
|
|
@@ -15,8 +15,6 @@ Extra-Tmp-Files: config.log config.status autom4te.cache cbits/config.h
|
2014-07-14 21:58:13 +00:00
|
|
|
Library
|
|
|
|
Default-Language: Haskell2010
|
|
|
|
GHC-Options: -Wall
|
2014-10-14 04:16:38 +00:00
|
|
|
- if impl(ghc >= 7.8)
|
|
|
|
- CC-Options: -fPIC
|
2014-07-14 21:58:13 +00:00
|
|
|
Exposed-Modules: Data.UnixTime
|
|
|
|
Other-Modules: Data.UnixTime.Conv
|
|
|
|
Data.UnixTime.Diff
|
2013-09-23 00:14:48 +00:00
|
|
|
--
|
|
|
|
1.7.10.4
|
|
|
|
|