@@ -15,21 +15,21 @@ import Control.Monad.Catch
1515 ( MonadThrow )
1616import Data.ByteString
1717 ( ByteString )
18- #if !defined(__MHS__)
1918import Language.Haskell.TH.Quote
2019 ( QuasiQuoter (.. ) )
2120import Language.Haskell.TH.Syntax
2221 ( Lift (.. ), lift )
23- import System.IO
24- ( TextEncoding )
25- #else
26- import GHC.IO.Encoding.Types ( TextEncoding )
27- #endif
2822import GHC.IO.Encoding.Failure ( CodingFailureMode (.. ) )
2923
3024import System.OsString.Internal.Types
3125import System.OsPath.Encoding
3226import Control.Monad (when )
27+ #if !defined(__MHS__)
28+ import System.IO
29+ ( TextEncoding )
30+ #else
31+ import GHC.IO.Encoding.Types ( TextEncoding )
32+ #endif
3333
3434#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
3535import qualified System.OsPath.Windows as PF
@@ -128,7 +128,7 @@ fromBytes = OS.fromBytes
128128
129129
130130
131- #if ! defined(__MHS__ )
131+ #if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter )
132132-- | QuasiQuote an 'OsPath'. This accepts Unicode characters
133133-- and encodes as UTF-8 on unix and UTF-16LE on windows. Runs 'isValid'
134134-- on the input. If used as a pattern, requires turning on the @ViewPatterns@
@@ -164,7 +164,10 @@ osp = QuasiQuoter
164164 fail " illegal QuasiQuote (allowed as expression or pattern only, used as a declaration)"
165165 }
166166#endif
167- #endif /* !defined(__MHS__) */
167+ #else
168+ osp :: a
169+ osp = error " Systen.OsPath.Internal.ostr: no Template Haskell"
170+ #endif /* defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) */
168171
169172
170173-- | Unpack an 'OsPath' to a list of 'OsChar'.
0 commit comments