on master help sign in
Merge branch 'windows_support' of https://github.com/agentm/project-m36 into windows_support
commitf1dfb0979b17d46e01d69f4ed8f8f3fb5549851b authorAgentM <agentm@themactionfaction.com> dateTue 12 Jul 2016, 11:16 (10 years ago) parentc45d9f74f8b36b
1 file changed+3−3
ProjectM36/Persist.hs+3−3
ProjectM36/Persist.hs+3−3
@@ -7,7 +7,7 @@ module ProjectM36.Persist (writeFileSync,
77-- on Windows, use FlushFileBuffers and MoveFileEx
88
99#if defined(mingw32_HOST_OS)
10−import System.Win32.File (flushFileBuffers)
10+import qualified System.Win32 as Win32
1111#else
1212import qualified System.Posix as Posix
1313import System.Posix.Unistd (fileSynchroniseDataOnly)
@@ -41,7 +41,7 @@ renameSync sync srcPath dstPath = do
4141-- System.Directory's renameFile/renameDirectory almost do exactly what we want except that it needlessly differentiates between directories and files
4242atomicRename :: FilePath -> FilePath -> IO ()
4343atomicRename srcPath dstPath = do
44−#if defined(ming32_HOST_OS)
44+#if defined(mingw32_HOST_OS)
4545 Win32.moveFileEx srcPath dstPath Win32.mOVEFILE_REPLACE_EXISTING
4646#else
4747 Posix.rename srcPath dstPath
@@ -50,7 +50,7 @@ atomicRename srcPath dstPath = do
5050syncHandle :: DiskSync -> Handle -> IO ()
5151syncHandle FsyncDiskSync handle = do
5252#if defined(mingw32_HOST_OS)
53− withHandleToHANDLE handle (\h -> flushFileBuffers h)
53+ withHandleToHANDLE handle (\h -> Win32.flushFileBuffers h)
5454#else
5555 handleToFd handle >>= fileSynchroniseDataOnly
5656#endif