From 2fab8634adee9308d7df00ddd75f162543290c65 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 4 May 2015 11:17:01 -0400 Subject: [PATCH] Attempt to improve GHC version support Hopefully this helps people who aren't running the latest GHC until the whole Mode system is gutted and replaced. See github:nwf/dyna#81 --- dyna.cabal | 6 ++++++ src/Dyna/Analysis/Mode/Execution/Functions.hs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/dyna.cabal b/dyna.cabal index aec6a05..3b73ba0 100644 --- a/dyna.cabal +++ b/dyna.cabal @@ -100,6 +100,9 @@ Executable dyna ghc-options: -Wall -main-is Dyna.Main.Driver + if (impl(ghc < 7.7)) + cpp-options: -DDYNA_GHC_PRE_77 + Build-Depends: ansi-wl-pprint >= 0.6, base >=4 && <6, bytestring >=0.9, @@ -135,6 +138,9 @@ Test-suite dyna-selftests ghc-options: -Wall -main-is Dyna.Main.TestsDriver + if (impl(ghc < 7.7)) + cpp-options: -DDYNA_GHC_PRE_77 + Build-Depends: ansi-wl-pprint >= 0.6, base >=4 && <6, bytestring >=0.9, diff --git a/src/Dyna/Analysis/Mode/Execution/Functions.hs b/src/Dyna/Analysis/Mode/Execution/Functions.hs index 43e1050..8f6164d 100644 --- a/src/Dyna/Analysis/Mode/Execution/Functions.hs +++ b/src/Dyna/Analysis/Mode/Execution/Functions.hs @@ -3,6 +3,7 @@ -- call during mode analysis. -- Header material {{{ +{-# LANGUAGE CPP #-} -- XXX doCall {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} @@ -10,7 +11,11 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} + -- XXX can't use MIN_TOOL_VERSION because there are still + -- very old cabals out in the wild. :( +#ifndef DYNA_GHC_PRE_77 {-# LANGUAGE AllowAmbiguousTypes #-} -- XXX doCall +#endif {-# OPTIONS_GHC -Wall #-} module Dyna.Analysis.Mode.Execution.Functions ( -- 2.50.1