From 85a778825b364145f368c419fc3ea3d7da06ed93 Mon Sep 17 00:00:00 2001 From: David Waern Date: Tue, 12 Aug 2008 22:40:39 +0000 Subject: 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). --- src/Haddock/InterfaceFile.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/Haddock') 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 -- cgit v1.2.3