From a5d9e1cad53736e0f95a7a1dce53637eef30eda0 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Thu, 14 Nov 2024 22:34:28 +0530 Subject: [PATCH] Don't use QuasiQuotes This extension is unused and can't be used in boot libraries --- System/File/OsPath/Internal.hs | 1 - windows/System/File/Platform.hsc | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/System/File/OsPath/Internal.hs b/System/File/OsPath/Internal.hs index e057d90..a18086f 100644 --- a/System/File/OsPath/Internal.hs +++ b/System/File/OsPath/Internal.hs @@ -2,7 +2,6 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ViewPatterns #-} -{-# LANGUAGE QuasiQuotes #-} module System.File.OsPath.Internal where diff --git a/windows/System/File/Platform.hsc b/windows/System/File/Platform.hsc index f25800b..e226e66 100644 --- a/windows/System/File/Platform.hsc +++ b/windows/System/File/Platform.hsc @@ -1,19 +1,19 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE TypeApplications #-} -{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE PackageImports #-} module System.File.Platform where import Control.Exception (bracketOnError, try, SomeException, onException) import Data.Bits +import Data.Maybe (fromJust) import System.IO (IOMode(..), Handle) import System.OsPath.Windows ( WindowsPath ) import qualified System.OsPath.Windows as WS import Foreign.C.Types import qualified System.OsString.Windows as WS hiding (decodeFS) -import System.OsString.Windows ( pstr, WindowsString ) +import System.OsString.Windows ( encodeUtf, WindowsString ) import qualified System.Win32 as Win32 import qualified System.Win32.WindowsString.File as WS import System.Win32.WindowsString.Types (withTString, peekTString) @@ -160,7 +160,7 @@ findTempName :: (WindowsString, WindowsString) findTempName (prefix, suffix) loc tmp_dir mode = go where go = do - let label = if prefix == mempty then [pstr|ghc|] else prefix + let label = if prefix == mempty then fromJust (encodeUtf "ghc") else prefix #if MIN_VERSION_Win32(2, 14, 0) withFilePath tmp_dir $ \c_tmp_dir -> #else