aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/InterfaceFile.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/InterfaceFile.hs')
-rw-r--r--src/Haddock/InterfaceFile.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs
index 59dc768c..08dd2d2a 100644
--- a/src/Haddock/InterfaceFile.hs
+++ b/src/Haddock/InterfaceFile.hs
@@ -48,8 +48,24 @@ data InterfaceFile = InterfaceFile {
binaryInterfaceMagic :: Word32
binaryInterfaceMagic = 0xD0Cface
+
+-- Since datatypes in GHC might change between patchlevel versions,
+-- and because we store GHC datatypes in our interface files,
+-- we need to make sure we version our interface files accordingly.
+--
+-- Instead of adding one, we add three to all version numbers
+-- when one of our own (stored) datatypes is changed.
binaryInterfaceVersion :: Word16
-binaryInterfaceVersion = 1
+#if __GLASGOW_HASKELL__ == 608 && __GHC_PATCHLEVEL__ == 2
+binaryInterfaceVersion = 2
+#endif
+#if __GLASGOW_HASKELL__ == 608 && __GHC_PATCHLEVEL__ == 3
+binaryInterfaceVersion = 3
+#endif
+#if __GLASGOW_HASKELL__ >= 609
+binaryInterfaceVersion = 4
+#endif
+
initBinMemSize :: Int
initBinMemSize = 1024*1024