Skip to content

Commit

Permalink
mingw32_TARGET_OS is never defined for non-GHC code.
Browse files Browse the repository at this point in the history
AFAIK. We don't use this form consistently anyhow. Also fix a typo.
  • Loading branch information
23Skidoo committed Apr 20, 2014
1 parent dc7bf93 commit b7db520
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/InstallSymlink.hs
Expand Up @@ -16,7 +16,7 @@ module Distribution.Client.InstallSymlink (
symlinkBinary,
) where

#if mingw32_HOST_OS || mingw32_TARGET_OS
#if mingw32_HOST_OS

import Distribution.Package (PackageIdentifier)
import Distribution.Client.InstallPlan (InstallPlan)
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Win32SelfUpgrade.hs
Expand Up @@ -42,7 +42,7 @@ module Distribution.Client.Win32SelfUpgrade (
deleteOldExeFile,
) where

#if mingw32_HOST_OS || mingw32_TARGET_OS
#if mingw32_HOST_OS

import qualified System.Win32 as Win32
import qualified System.Win32.DLL as Win32
Expand Down
8 changes: 4 additions & 4 deletions cabal-install/Main.hs
Expand Up @@ -104,7 +104,7 @@ import Distribution.Client.Sandbox.Types (UseSandbox(..), whenUsingSandbox)
import Distribution.Client.Init (initCabal)
import qualified Distribution.Client.Win32SelfUpgrade as Win32SelfUpgrade
import Distribution.Client.Utils (determineNumJobs
#if defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS)
#if defined(mingw32_HOST_OS)
,relaxEncodingErrors
#endif
,existsAndIsMoreRecentThan)
Expand Down Expand Up @@ -147,7 +147,7 @@ import System.Environment (getArgs, getProgName)
import System.Exit (exitFailure)
import System.FilePath (splitExtension, takeExtension)
import System.IO ( BufferMode(LineBuffering), hSetBuffering
#if defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS)
#ifdef mingw32_HOST_OS
, stderr
#endif
, stdout )
Expand All @@ -163,10 +163,10 @@ main = do
-- Enable line buffering so that we can get fast feedback even when piped.
-- This is especially important for CI and build systems.
hSetBuffering stdout LineBuffering
-- The default locale encoding for Window's CLI is not UTF-8 and printing
-- The default locale encoding for Windows CLI is not UTF-8 and printing
-- Unicode characters to it will fail unless we relax the handling of encoding
-- errors when writing to stderr and stdout.
#if defined(mingw32_HOST_OS) || defined(mingw32_TARGET_OS)
#ifdef mingw32_HOST_OS
relaxEncodingErrors stdout
relaxEncodingErrors stderr
#endif
Expand Down

0 comments on commit b7db520

Please sign in to comment.