Skip to content

Commit

Permalink
Conditional compilation for Binary Text (fixes #281)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed May 25, 2015
1 parent 0e466c4 commit c13d84d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ide-backend-common/IdeSession/Util.hs
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables, DeriveFunctor, DeriveGeneric, StandaloneDeriving, GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IdeSession.Util (
Expand Down Expand Up @@ -312,6 +313,7 @@ captureOutput act = do
Orphans
-------------------------------------------------------------------------------}

#if !MIN_VERSION_text(1,2,1)
instance Binary Text where

This comment has been minimized.

Copy link
@hvr

hvr May 25, 2015

Contributor

Just wondering, is this encoding the same as text-1.2.1 uses? If not, will a different encoding be noticeable by users?

This comment has been minimized.

Copy link
@snoyberg

snoyberg May 25, 2015

Author Member

It's a good question, I don't know. I don't think users will notice, assuming that they compile both ide-backend and ide-backend-server against the same version of text.

get = do units <- Bin.get
Bin.readNWith (units * 2) $ \ptr ->
Expand All @@ -321,5 +323,6 @@ instance Binary Text where
Bin.putBuilder $
Bin.writeN (Text.lengthWord16 t * 2)
(\p -> Text.unsafeCopyToPtr t (castPtr p))
#endif

deriving instance Binary CPid
4 changes: 2 additions & 2 deletions ide-backend-common/ide-backend-common.cabal
@@ -1,5 +1,5 @@
name: ide-backend-common
version: 0.9.1.1
version: 0.9.1.2
synopsis: Shared library used be ide-backend and ide-backend-server
description: Should not be used by end users
license: MIT
Expand All @@ -10,7 +10,7 @@ copyright: (c) 2015 FP Complete
category: Development
build-type: Simple
cabal-version: >=1.10
extra-source-files: README.md
extra-source-files: README.md ChangeLog.md

library
exposed-modules: IdeSession.Util
Expand Down

0 comments on commit c13d84d

Please sign in to comment.