[commit: packages/containers] develop-0.6, develop-0.6-questionable, master, zip-devel: Provide default MIN_VERSION_base if not available. (0762786)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 22:40:47 UTC 2015


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

On branches: develop-0.6,develop-0.6-questionable,master,zip-devel
Link       : http://git.haskell.org/packages/containers.git/commitdiff/076278627b6b3fda9522a9ca971f2467947527d6

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

commit 076278627b6b3fda9522a9ca971f2467947527d6
Author: Milan Straka <fox at ucw.cz>
Date:   Sun Oct 19 10:43:09 2014 +0200

    Provide default MIN_VERSION_base if not available.
    
    After #56, we use MIN_VERSION_base in many places. We now provide
    trivial MIN_VERSION_base if not available to allow compiling without
    cabal.


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

076278627b6b3fda9522a9ca971f2467947527d6
 Data/IntMap/Base.hs | 8 ++++++++
 Data/IntSet/Base.hs | 8 ++++++++
 Data/Map/Base.hs    | 8 ++++++++
 Data/Sequence.hs    | 8 ++++++++
 Data/Set/Base.hs    | 8 ++++++++
 Data/Tree.hs        | 8 ++++++++
 6 files changed, 48 insertions(+)

diff --git a/Data/IntMap/Base.hs b/Data/IntMap/Base.hs
index 0de3e5b..8f2e32f 100644
--- a/Data/IntMap/Base.hs
+++ b/Data/IntMap/Base.hs
@@ -247,6 +247,14 @@ import Text.Read
 -- want the compilers to be compiled by as many compilers as possible.
 #define STRICT_1_OF_2(fn) fn arg _ | arg `seq` False = undefined
 
+-- We use cabal-generated MIN_VERSION_base to adapt to changes of base.
+-- Nevertheless, as a convenience, we also allow compiling without cabal by
+-- defining trivial MIN_VERSION_base if needed.
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(major1,major2,minor) 0
+#endif
+
+
 -- A "Nat" is a natural machine word (an unsigned Int)
 type Nat = Word
 
diff --git a/Data/IntSet/Base.hs b/Data/IntSet/Base.hs
index c8e70f6..b6f8014 100644
--- a/Data/IntSet/Base.hs
+++ b/Data/IntSet/Base.hs
@@ -202,6 +202,14 @@ import GHC.Prim (indexInt8OffAddr#)
 #define STRICT_1_OF_3(fn) fn arg _ _ | arg `seq` False = undefined
 #define STRICT_2_OF_3(fn) fn _ arg _ | arg `seq` False = undefined
 
+-- We use cabal-generated MIN_VERSION_base to adapt to changes of base.
+-- Nevertheless, as a convenience, we also allow compiling without cabal by
+-- defining trivial MIN_VERSION_base if needed.
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(major1,major2,minor) 0
+#endif
+
+
 infixl 9 \\{-This comment teaches CPP correct behaviour -}
 
 -- A "Nat" is a natural machine word (an unsigned Int)
diff --git a/Data/Map/Base.hs b/Data/Map/Base.hs
index 72934e9..edcfdb7 100644
--- a/Data/Map/Base.hs
+++ b/Data/Map/Base.hs
@@ -299,6 +299,14 @@ import Data.Data
 #define STRICT_1_OF_4(fn) fn arg _ _ _ | arg `seq` False = undefined
 #define STRICT_2_OF_4(fn) fn _ arg _ _ | arg `seq` False = undefined
 
+-- We use cabal-generated MIN_VERSION_base to adapt to changes of base.
+-- Nevertheless, as a convenience, we also allow compiling without cabal by
+-- defining trivial MIN_VERSION_base if needed.
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(major1,major2,minor) 0
+#endif
+
+
 {--------------------------------------------------------------------
   Operators
 --------------------------------------------------------------------}
diff --git a/Data/Sequence.hs b/Data/Sequence.hs
index f1385f5..a2b4844 100644
--- a/Data/Sequence.hs
+++ b/Data/Sequence.hs
@@ -160,6 +160,14 @@ import Text.Read (Lexeme(Ident), lexP, parens, prec,
 import Data.Data
 #endif
 
+-- We use cabal-generated MIN_VERSION_base to adapt to changes of base.
+-- Nevertheless, as a convenience, we also allow compiling without cabal by
+-- defining trivial MIN_VERSION_base if needed.
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(major1,major2,minor) 0
+#endif
+
+
 infixr 5 `consTree`
 infixl 5 `snocTree`
 
diff --git a/Data/Set/Base.hs b/Data/Set/Base.hs
index 9260aeb..e676a6f 100644
--- a/Data/Set/Base.hs
+++ b/Data/Set/Base.hs
@@ -214,6 +214,14 @@ import Data.Data
 #define STRICT_1_OF_3(fn) fn arg _ _ | arg `seq` False = undefined
 #define STRICT_2_OF_3(fn) fn _ arg _ | arg `seq` False = undefined
 
+-- We use cabal-generated MIN_VERSION_base to adapt to changes of base.
+-- Nevertheless, as a convenience, we also allow compiling without cabal by
+-- defining trivial MIN_VERSION_base if needed.
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(major1,major2,minor) 0
+#endif
+
+
 {--------------------------------------------------------------------
   Operators
 --------------------------------------------------------------------}
diff --git a/Data/Tree.hs b/Data/Tree.hs
index 2f18c68..c880213 100644
--- a/Data/Tree.hs
+++ b/Data/Tree.hs
@@ -45,6 +45,14 @@ import Control.DeepSeq (NFData(rnf))
 import Data.Data (Data)
 #endif
 
+-- We use cabal-generated MIN_VERSION_base to adapt to changes of base.
+-- Nevertheless, as a convenience, we also allow compiling without cabal by
+-- defining trivial MIN_VERSION_base if needed.
+#ifndef MIN_VERSION_base
+#define MIN_VERSION_base(major1,major2,minor) 0
+#endif
+
+
 -- | Multi-way trees, also known as /rose trees/.
 data Tree a = Node {
         rootLabel :: a,         -- ^ label value



More information about the ghc-commits mailing list