[commit: packages/directory] Mistuke-bump-win32-version-bounds, bgamari-patch-1, master: Fix CPP usage (0500f25)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:34:25 UTC 2017


Repository : ssh://git@git.haskell.org/directory

On branches: Mistuke-bump-win32-version-bounds,bgamari-patch-1,master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0500f253ec77f3dd9b4432b0b83895f6fa08bb12/directory

>---------------------------------------------------------------

commit 0500f253ec77f3dd9b4432b0b83895f6fa08bb12
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sun Oct 23 12:42:59 2016 +1100

    Fix CPP usage
    
    The code had a a mixture of `#ifdef mingw32_HOST_OS` and `#if ..`. The
    later works, but is not really correct. GHC HEAD now has a `-Wcpp-undef`
    warning that we would like to turn on and hence need this fixed.


>---------------------------------------------------------------

0500f253ec77f3dd9b4432b0b83895f6fa08bb12
 System/Directory.hs | 2 +-
 tests/TestUtils.hs  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/System/Directory.hs b/System/Directory.hs
index 2646bde..9cc9d03 100644
--- a/System/Directory.hs
+++ b/System/Directory.hs
@@ -635,7 +635,7 @@ The operand refers to an existing directory.
 
 removeFile :: FilePath -> IO ()
 removeFile path =
-#if mingw32_HOST_OS
+#ifdef mingw32_HOST_OS
   Win32.deleteFile path
 #else
   Posix.removeLink path
diff --git a/tests/TestUtils.hs b/tests/TestUtils.hs
index b04cbb0..80dda16 100644
--- a/tests/TestUtils.hs
+++ b/tests/TestUtils.hs
@@ -52,7 +52,7 @@ modifyPermissions path modify = do
   permissions <- getPermissions path
   setPermissions path (modify permissions)
 
-#if mingw32_HOST_OS
+#ifdef mingw32_HOST_OS
 createSymbolicLink :: String -> String -> IO ()
 createSymbolicLink target link =
   (`ioeSetLocation` "createSymbolicLink") `modifyIOError` do



More information about the ghc-commits mailing list