[commit: haddock] ghc-7.6: Allow to load interface files with compatible versions (409b25a)

Simon Hengel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/409b25a0e9821687eeffde3d6bdb87f0fd9c73f9

>---------------------------------------------------------------

commit 409b25a0e9821687eeffde3d6bdb87f0fd9c73f9
Author: Simon Hengel <[email protected]>
Date:   Tue Oct 9 15:31:06 2012 +0200

    Allow to load interface files with compatible versions

>---------------------------------------------------------------

 src/Haddock/InterfaceFile.hs |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs
index 78ab892..1f6b489 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.