aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/InterfaceFile.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-08-12 22:40:39 +0000
committerDavid Waern <david.waern@gmail.com>2008-08-12 22:40:39 +0000
commit85a778825b364145f368c419fc3ea3d7da06ed93 (patch)
treeea2b92105d99959c107d66bccdf30b1ee3f806eb /src/Haddock/InterfaceFile.hs
parenta65c6206d5d226d93a2ed985d9f196931748c722 (diff)
Make our .haddock file version number depend on the GHC version
We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes).
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