[commit: packages/time] master: Fix compilation on GHC 7.0 by not using Trustworthy (603b058)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 07:56:44 UTC 2015


Repository : ssh://git@git.haskell.org/time

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/603b05864dbba686873828c2498c75e73a3adc9a

>---------------------------------------------------------------

commit 603b05864dbba686873828c2498c75e73a3adc9a
Author: Adam Bergmark <adam at bergmark.nl>
Date:   Mon Jul 13 10:59:41 2015 +0200

    Fix compilation on GHC 7.0 by not using Trustworthy


>---------------------------------------------------------------

603b05864dbba686873828c2498c75e73a3adc9a
 lib/Data/Time/Clock/CTimeval.hs     | 2 +-
 lib/Data/Time/Clock/Scale.hs        | 3 ++-
 lib/Data/Time/Clock/UTC.hs          | 3 ++-
 lib/Data/Time/LocalTime/TimeZone.hs | 2 +-
 time.cabal                          | 3 +--
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/Data/Time/Clock/CTimeval.hs b/lib/Data/Time/Clock/CTimeval.hs
index add0bf9..8c2d550 100644
--- a/lib/Data/Time/Clock/CTimeval.hs
+++ b/lib/Data/Time/Clock/CTimeval.hs
@@ -4,7 +4,7 @@ module Data.Time.Clock.CTimeval where
 #ifndef mingw32_HOST_OS
 -- All Unix-specific, this
 
-#if __GLASGOW_HASKELL__ >= 709
+#if __GLASGOW_HASKELL__ >= 709 || __GLASGOW_HASKELL__ < 702
 import Foreign
 #else
 import Foreign.Safe
diff --git a/lib/Data/Time/Clock/Scale.hs b/lib/Data/Time/Clock/Scale.hs
index 5838b4d..6cef322 100644
--- a/lib/Data/Time/Clock/Scale.hs
+++ b/lib/Data/Time/Clock/Scale.hs
@@ -1,4 +1,6 @@
+#if __GLASGOW_HASKELL__ >= 702
 {-# LANGUAGE Trustworthy #-}
+#endif
 {-# OPTIONS -fno-warn-unused-imports #-}
 #include "HsConfigure.h"
 -- #hide
@@ -107,4 +109,3 @@ picosecondsToDiffTime x = fromRational (x % 1000000000000)
 "realToFrac/DiffTime->Pico"              realToFrac = \ (MkDiffTime ps) -> ps
 "realToFrac/Pico->DiffTime"              realToFrac = MkDiffTime
   #-}
-
diff --git a/lib/Data/Time/Clock/UTC.hs b/lib/Data/Time/Clock/UTC.hs
index eff7f4d..3e27076 100644
--- a/lib/Data/Time/Clock/UTC.hs
+++ b/lib/Data/Time/Clock/UTC.hs
@@ -1,5 +1,7 @@
 {-# OPTIONS -fno-warn-unused-imports #-}
+#if __GLASGOW_HASKELL__ >= 702
 {-# LANGUAGE Trustworthy #-}
+#endif
 #include "HsConfigure.h"
 -- #hide
 module Data.Time.Clock.UTC
@@ -122,4 +124,3 @@ instance RealFrac NominalDiffTime where
 "realToFrac/NominalDiffTime->Pico"       realToFrac = \ (MkNominalDiffTime ps) -> ps
 "realToFrac/Pico->NominalDiffTime"       realToFrac = MkNominalDiffTime
   #-}
-
diff --git a/lib/Data/Time/LocalTime/TimeZone.hs b/lib/Data/Time/LocalTime/TimeZone.hs
index 90846f2..9381075 100644
--- a/lib/Data/Time/LocalTime/TimeZone.hs
+++ b/lib/Data/Time/LocalTime/TimeZone.hs
@@ -17,7 +17,7 @@ import Data.Time.Calendar.Private
 import Data.Time.Clock.POSIX
 import Data.Time.Clock.UTC
 
-#if __GLASGOW_HASKELL__ >= 709
+#if __GLASGOW_HASKELL__ >= 709 || __GLASGOW_HASKELL__ < 702
 import Foreign
 #else
 import Foreign.Safe
diff --git a/time.cabal b/time.cabal
index ed6479e..34f7f58 100644
--- a/time.cabal
+++ b/time.cabal
@@ -48,7 +48,7 @@ library
             cpp-options: -DLANGUAGE_Rank2Types
     ghc-options: -Wall -fwarn-tabs
     build-depends:
-        base >= 4.4 && < 5,
+        base >= 4.3 && < 5,
         deepseq >= 1.1
     if os(windows)
         build-depends: Win32
@@ -149,4 +149,3 @@ test-suite tests
         Test.AddDays
         Test.AddDaysRef
         Test.TestUtil
-



More information about the ghc-commits mailing list