summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-03-04 14:13:41 +0000
committerhallgren <hallgren@chalmers.se>2014-03-04 14:13:41 +0000
commit76ba865c2ed85bdf9de5f936da2e064ce8ed3816 (patch)
tree648b63ff7bb10b104ca37e215cf7c93e52a61d88
parentcbe17732a68cc6ccc8b516de0533d00209ffffd7 (diff)
Three fixes for compatibility with GHC 7.8
Two of the fixes were in the custom version of the binary package. We should get rid of it at some point, to reduce the maintenance burden. The third fix was to add new version constraints for happy and alex in gf.cabal. New versions of them are needed because of the ugly, low-level, GHC-specific code they produce need to be different for GHC 7.8. More fixes might be needed for -server mode, but the cgi package is not compatible with GHC 7.8 at the moment, so it will have to wait.
-rw-r--r--gf.cabal7
-rw-r--r--src/binary/Data/Binary/Builder.hs1
-rw-r--r--src/binary/Data/Binary/Get.hs3
3 files changed, 10 insertions, 1 deletions
diff --git a/gf.cabal b/gf.cabal
index cf36106a3..3e823f26e 100644
--- a/gf.cabal
+++ b/gf.cabal
@@ -159,7 +159,12 @@ Executable gf
--if flag(new-comp)
-- cpp-options: -DNEW_COMP
- build-tools: happy, alex>=3
+ build-tools: happy
+
+ if impl(ghc>=7.8)
+ build-tools: happy>=1.19, alex>=3.1
+ else
+ build-tools: happy, alex>=3
if os(windows)
build-depends: Win32
diff --git a/src/binary/Data/Binary/Builder.hs b/src/binary/Data/Binary/Builder.hs
index 183483945..6aee97964 100644
--- a/src/binary/Data/Binary/Builder.hs
+++ b/src/binary/Data/Binary/Builder.hs
@@ -55,6 +55,7 @@ module Data.Binary.Builder (
) where
import Foreign
+import System.IO.Unsafe(unsafePerformIO)
import Data.Monoid
--import Data.Word
import qualified Data.ByteString as S
diff --git a/src/binary/Data/Binary/Get.hs b/src/binary/Data/Binary/Get.hs
index c2c43b691..0a2f12117 100644
--- a/src/binary/Data/Binary/Get.hs
+++ b/src/binary/Data/Binary/Get.hs
@@ -89,6 +89,9 @@ import Control.Applicative (Applicative(..))
import Foreign
-- used by splitAtST
+#if MIN_VERSION_base(4,6,0)
+import Control.Monad.ST.Unsafe(unsafeInterleaveST)
+#endif
import Control.Monad.ST
import Data.STRef