Prepare GHC-8.0 compat
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 7 Jun 2016 11:45:19 +0000 (13:45 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 7 Jun 2016 11:49:59 +0000 (13:49 +0200)
cbits/HeapView.c
ghc-heap-view.cabal
src/GHC/Disassembler.hs
src/GHC/HeapView.hs

index 17dd24d..f2bce47 100644 (file)
@@ -62,7 +62,7 @@ char *gtc_heap_view_closure_type_names[] = {
  [RET_BCO]               = "RET_BCO",
  [RET_SMALL]             = "RET_SMALL",
  [RET_BIG]               = "RET_BIG",
-#ifndef GHC_7_7
+#if !defined(GHC_7_7) && !defined(GHC_8_0)
  [RET_DYN]               = "RET_DYN",
 #endif
  [RET_FUN]               = "RET_FUN",
@@ -74,7 +74,7 @@ char *gtc_heap_view_closure_type_names[] = {
  [BLOCKING_QUEUE]        = "BLOCKING_QUEUE",
  [MVAR_CLEAN]            = "MVAR_CLEAN",
  [MVAR_DIRTY]            = "MVAR_DIRTY",
-#ifdef GHC_7_7
+#if defined(GHC_7_7) || defined(GHC_8_0)
  [TVAR]                  = "TVAR",
 #endif
  [ARR_WORDS]             = "ARR_WORDS",
index 39c657e..33b8da0 100644 (file)
@@ -58,26 +58,35 @@ Flag prim-supports-any
 
 Flag ghc_7_7
 
+Flag ghc_8_0
+
 Library
   Default-Language:    Haskell2010
   Exposed-modules:
-    GHC.HeapView 
-    GHC.AssertNF 
+    GHC.HeapView
+    GHC.AssertNF
     GHC.Disassembler
     GHC.HeapView.Debug
   Build-depends:
-    base >= 4.5 && < 4.9,
+    base >= 4.5 && < 4.10,
     containers,
     transformers,
     template-haskell,
     bytestring >= 0.10,
     binary
+
   if flag(ghc_7_7)
-    build-depends: ghc >= 7.7
+    build-depends: ghc >= 7.7 && < 8
     cc-options: -DGHC_7_7
     cpp-options: -DGHC_7_7
   else
-    build-depends: ghc < 7.7
+    if flag(ghc_8_0)
+      build-depends: ghc >= 8
+      cc-options: -DGHC_8_0
+      cpp-options: -DGHC_8_0
+    else
+      build-depends: ghc < 7.7
+
   C-Sources: cbits/HeapView.c cbits/HeapViewPrim.cmm
   Hs-source-dirs: src/
   Ghc-options: -Wall
index c4375f3..2ef077d 100644 (file)
@@ -299,8 +299,11 @@ data BCI box
     | BCITESTEQ_W Word Int
     deriving (Show, Functor, Traversable, Foldable)
 
+#if MIN_VERSION_binary(0,8,1)
+#else
 getInthost :: Get Int
 getInthost = fromIntegral <$> getWordhost
 
 getInt16host :: Get Int16
 getInt16host = fromIntegral <$> getWord16host
+#endif
index 1828f48..d283cf1 100644 (file)
@@ -241,7 +241,7 @@ data ClosureType =
         | RET_BCO
         | RET_SMALL
         | RET_BIG
-#ifndef GHC_7_7
+#if !defined(GHC_7_7) && !defined(GHC_8_0)
         | RET_DYN
 #endif
         | RET_FUN
@@ -253,7 +253,7 @@ data ClosureType =
         | BLACKHOLE
         | MVAR_CLEAN
         | MVAR_DIRTY
-#ifdef GHC_7_7
+#if defined(GHC_7_7) || defined(GHC_8_0)
         | TVAR
 #endif
         | ARR_WORDS