mirror of
https://github.com/serokell/haskell-with-utf8.git
synced 2024-10-05 19:17:07 +03:00
[#9] Fix compilation of executable on Windows
Problem: Compilation of the executable on Windows fails with 'Module `GHC.IO.Encoding.Iconv' does not export `localeEncodingName'` Solution: Check if we are on Windows, and don't import such module or use `localeEncodingName` if it's the case.
This commit is contained in:
parent
57b6845f5e
commit
19bcaa2419
@ -20,7 +20,9 @@ import Data.Maybe (isJust)
|
||||
import Data.Version (showVersion)
|
||||
import Foreign.C.String (CString, peekCAString)
|
||||
import GHC.IO.Encoding (getLocaleEncoding, initLocaleEncoding)
|
||||
#if !(defined(mingw32_HOST_OS) || defined(__MINGW32__))
|
||||
import GHC.IO.Encoding.Iconv (localeEncodingName)
|
||||
#endif
|
||||
import GHC.Show (showLitString)
|
||||
import Language.Haskell.TH.Env (envQ)
|
||||
import System.Directory (doesDirectoryExist, doesPathExist, listDirectory)
|
||||
@ -93,7 +95,9 @@ showGhc = do
|
||||
showCbits :: IO ()
|
||||
showCbits = do
|
||||
putStrLn "# C bits"
|
||||
#if !(defined(mingw32_HOST_OS) || defined(__MINGW32__))
|
||||
putStrLn $ " * localeEncodingName = " <> localeEncodingName
|
||||
#endif
|
||||
showLibcharset
|
||||
showLanginfoh
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user