From 76ba865c2ed85bdf9de5f936da2e064ce8ed3816 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 4 Mar 2014 14:13:41 +0000 Subject: [PATCH] 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. --- gf.cabal | 7 ++++++- src/binary/Data/Binary/Builder.hs | 1 + src/binary/Data/Binary/Get.hs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) 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