From 409b25a0e9821687eeffde3d6bdb87f0fd9c73f9 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 15:31:06 +0200 Subject: Allow to load interface files with compatible versions --- src/Haddock/InterfaceFile.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 78ab892b..1f6b489d 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -79,6 +79,9 @@ binaryInterfaceVersion = 22 #error Unknown GHC version #endif +binaryInterfaceVersionCompatibility :: [Word16] +binaryInterfaceVersionCompatibility = [21, 22] + initBinMemSize :: Int initBinMemSize = 1024*1024 @@ -187,7 +190,7 @@ readInterfaceFile (get_name_cache, set_name_cache) filename = do case () of _ | magic /= binaryInterfaceMagic -> return . Left $ "Magic number mismatch: couldn't load interface file: " ++ filename - | version /= binaryInterfaceVersion -> return . Left $ + | version `notElem` binaryInterfaceVersionCompatibility -> return . Left $ "Interface file is of wrong version: " ++ filename | otherwise -> with_name_cache $ \update_nc -> do -- cgit v1.2.3