diff options
| author | Sergei Trofimovich <slyfox@community.haskell.org> | 2012-03-26 20:48:57 +0000 |
|---|---|---|
| committer | Sergei Trofimovich <slyfox@community.haskell.org> | 2012-03-26 20:48:57 +0000 |
| commit | c015ac77bdda7ba4d957c61a6b861f14a69cccc6 (patch) | |
| tree | 2b5da550c8b6ab3b5751ca9442e179f506d589c6 /src/compiler/GF | |
| parent | 24740d250b195450e28b496733390633910da1cf (diff) | |
compiler/GF/Text/Coding.hs: fix build failure against ghc-7.2
Diffstat (limited to 'src/compiler/GF')
| -rw-r--r-- | src/compiler/GF/Text/Coding.hs | 13 |
1 files changed, 12 insertions, 1 deletions
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 |
