diff options
Diffstat (limited to 'standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch')
-rw-r--r-- | standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch b/standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch new file mode 100644 index 000000000..be7956bea --- /dev/null +++ b/standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch @@ -0,0 +1,56 @@ +From e6d5c141186dbdbe97c698294485ffc4dcd3a843 Mon Sep 17 00:00:00 2001 +From: dummy <dummy@example.com> +Date: Fri, 18 Oct 2013 16:45:50 +0000 +Subject: [PATCH] hack for bionic + cross build + +--- + Data/UnixTime/Types.hsc | 12 ------------ + cbits/conv.c | 2 +- + 2 files changed, 1 insertion(+), 13 deletions(-) + +diff --git a/Data/UnixTime/Types.hsc b/Data/UnixTime/Types.hsc +index d30f39b..ec7ca4c 100644 +--- a/Data/UnixTime/Types.hsc ++++ b/Data/UnixTime/Types.hsc +@@ -9,8 +9,6 @@ import Foreign.Storable + + #include <sys/time.h> + +-#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__) +- + -- | + -- Data structure for Unix time. + data UnixTime = UnixTime { +@@ -20,16 +18,6 @@ data UnixTime = UnixTime { + , 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) +- + -- | + -- Format of the strptime()/strftime() style. + type Format = ByteString +diff --git a/cbits/conv.c b/cbits/conv.c +index 7ff7b87..2e4c870 100644 +--- a/cbits/conv.c ++++ b/cbits/conv.c +@@ -55,7 +55,7 @@ time_t c_parse_unix_time_gmt(char *fmt, char *src) { + #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) { +-- +1.7.10.4 + |