From c015ac77bdda7ba4d957c61a6b861f14a69cccc6 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 26 Mar 2012 20:48:57 +0000 Subject: [PATCH] compiler/GF/Text/Coding.hs: fix build failure against ghc-7.2 --- src/compiler/GF/Text/Coding.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Text/Coding.hs b/src/compiler/GF/Text/Coding.hs index a206bb4d2..e347730e0 100644 --- a/src/compiler/GF/Text/Coding.hs +++ b/src/compiler/GF/Text/Coding.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module GF.Text.Coding where import qualified Data.ByteString as BS @@ -23,7 +25,11 @@ encodeUnicode enc s = where translate cod cbuf | i < w = do bbuf <- newByteBuffer 128 WriteBuffer +#if __GLASGOW_HASKELL__ >= 702 + (_,cbuf,bbuf) <- cod cbuf bbuf +#else (cbuf,bbuf) <- cod cbuf bbuf +#endif if isEmptyBuffer bbuf then ioe_invalidCharacter else do let bs = PS (bufRaw bbuf) (bufL bbuf) (bufR bbuf-bufL bbuf) @@ -46,7 +52,12 @@ decodeUnicode enc (PS fptr l len) = return s where translate cod bbuf cbuf - | i < w = do (bbuf,cbuf) <- cod bbuf cbuf + | i < w = do +#if __GLASGOW_HASKELL__ >= 702 + (_,bbuf,cbuf) <- cod bbuf cbuf +#else + (bbuf,cbuf) <- cod bbuf cbuf +#endif if isEmptyBuffer cbuf then ioe_invalidCharacter else unpack cod bbuf cbuf