Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conditional compilation for Binary Text (fixes #281)
- Loading branch information
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables, DeriveFunctor, DeriveGeneric, StandaloneDeriving, GeneralizedNewtypeDeriving #-} | ||
{-# OPTIONS_GHC -fno-warn-orphans #-} | ||
module IdeSession.Util ( | ||
|
@@ -312,6 +313,7 @@ captureOutput act = do | |
Orphans | ||
-------------------------------------------------------------------------------} | ||
|
||
#if !MIN_VERSION_text(1,2,1) | ||
instance Binary Text where | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
snoyberg
Author
Member
|
||
get = do units <- Bin.get | ||
Bin.readNWith (units * 2) $ \ptr -> | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just wondering, is this encoding the same as
text-1.2.1
uses? If not, will a different encoding be noticeable by users?