Skip to content

Commit 806b33c

Browse files
committed
fix build with Win32-2.6.0
My earlier change to rename broke building with the new version of Win32, which has a Maybe FilePath as the second moveFileEx parameter.
1 parent 0b2c5f2 commit 806b33c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/System/PosixCompat/Files.hsc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ readSymbolicLink _ = unsupported "readSymbolicLink"
392392
-- Renaming
393393

394394
rename :: FilePath -> FilePath -> IO ()
395+
#if MIN_VERSION_Win32(2, 6, 0)
396+
rename name1 name2 = moveFileEx name1 (Just name2) mOVEFILE_REPLACE_EXISTING
397+
#else
395398
rename name1 name2 = moveFileEx name1 name2 mOVEFILE_REPLACE_EXISTING
399+
#endif
396400

397401
-- -----------------------------------------------------------------------------
398402
-- chown()

0 commit comments

Comments
 (0)