on master help sign in
resolves #16- Windows support
commit0d23029d6af229482125ffaaf18f1631aeff3013 authorAgentM <agentm@themactionfaction.com> dateSun 3 Jul 2016, 11:34 (10 years ago) parent3a8b867
3 files changed+172−36
ProjectM36/Persist.hs+28−9 ProjectM36/Win32Handle.hs+57 project-m36.cabal+87−27
ProjectM36/Persist.hs+28−9
@@ -1,18 +1,28 @@
1−{-# LANGUAGE ForeignFunctionInterface #-}
1+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
22--this module is related to persisting Project:M36 structures to disk and not related to the persistent library
33module ProjectM36.Persist (writeFileSync,
44 writeBSFileSync,
55 renameSync,
66 DiskSync(..)) where
7−--import ProjectM36.DirectoryFsync (directoryFsync)
8−import System.Posix.Files (rename)
7+-- on Windows, use FlushFileBuffers and System.Directory's rename (which uses MoveFileEx)
8+import System.Directory (renameDirectory)
9+
10+#if defined(mingw32_HOST_OS)
11+import System.Win32.File (flushFileBuffers)
12+--import ProjectM36.Win32Handle
13+#else
914import System.Posix.Unistd (fileSynchroniseDataOnly)
1015import System.Posix.IO (handleToFd)
16+#endif
17+
1118import System.IO (withFile, IOMode(WriteMode), hPutStr, Handle)
1219import qualified Data.ByteString.Lazy as BS
13−import Foreign.C
1420
21+#if defined(mingw32_HOST_OS)
22+import ProjectM36.Win32Handle
23+#else
1524foreign import ccall unsafe "cDirectoryFsync" cHSDirectoryFsync :: CString -> IO (CInt)
25+#endif
1626
1727data DiskSync = NoDiskSync | FsyncDiskSync
1828
@@ -25,11 +35,16 @@ writeFileSync sync path strOut = withFile path WriteMode handler
2535
2636renameSync :: DiskSync -> FilePath -> FilePath -> IO ()
2737renameSync sync srcPath dstPath = do
28− rename srcPath dstPath
38+ renameDirectory srcPath dstPath
2939 syncDirectory sync dstPath
30−
31−syncHandle :: DiskSync -> Handle -> IO ()
32−syncHandle FsyncDiskSync handle = handleToFd handle >>= fileSynchroniseDataOnly
40+
41+syncHandle :: DiskSync -> Handle -> IO ()
42+syncHandle FsyncDiskSync handle = do
43+#if defined(mingw32_HOST_OS)
44+ withHandleToHANDLE handle (\h -> flushFileBuffers h)
45+#else
46+ handleToFd handle >>= fileSynchroniseDataOnly
47+#endif
3348syncHandle NoDiskSync _ = pure ()
3449
3550syncDirectory :: DiskSync -> FilePath -> IO ()
@@ -43,5 +58,9 @@ writeBSFileSync sync path bstring = do
4358 syncHandle sync handle
4459
4560directoryFsync :: FilePath -> IO ()
61+#if defined(mingw32_HOST_OS)
62+directoryFsync _ = pure () -- on Windows directory metadata cannot be synchronized- perhaps there is a workaround? resync a file in the directory?
63+#else
4664directoryFsync path = throwErrnoIfMinus1Retry_ "directoryFsync" (withCString path $ \cpath -> cHSDirectoryFsync cpath)
47−
65+#endif
66+
ProjectM36/Win32Handle.hsnew file+57
@@ -0,0 +1,57 @@
1+{-# LANGUAGE CPP #-}
2+module ProjectM36.Win32Handle where
3+import System.Win32.Types
4+import Control.Exception (bracket)
5+import Foreign.StablePtr
6+import Foreign.C.Types
7+import Control.Concurrent.MVar
8+
9+#if __GLASGOW_HASKELL__ >= 612
10+import GHC.IO.Handle.Types (Handle(..), Handle__(..))
11+import GHC.IO.FD (FD(..)) -- A wrapper around an Int32
12+import Data.Typeable
13+#else
14+import GHC.IOBase (Handle(..), Handle__(..))
15+import qualified GHC.IOBase as IOBase (FD) -- Just an Int32
16+#endif
17+
18+-- This essential function comes from the C runtime system. It is certainly provided by msvcrt, and also seems to be provided by the mingw C library - hurrah!
19+#if __GLASGOW_HASKELL__ >= 612
20+foreign import ccall unsafe "_get_osfhandle" cget_osfhandle :: CInt -> IO HANDLE
21+#else
22+foreign import ccall unsafe "_get_osfhandle" cget_osfhandle :: IOBase.FD -> IO HANDLE
23+#endif
24+
25+-- copied from ansi-terminal package
26+-- | This bit is all highly dubious. The problem is that we want to output ANSI to arbitrary Handles rather than forcing
27+-- people to use stdout. However, the Windows ANSI emulator needs a Windows HANDLE to work it's magic, so we need to be able
28+-- to extract one of those from the Haskell Handle.
29+--
30+-- This code accomplishes this, albeit at the cost of only being compatible with GHC.
31+withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a
32+withHandleToHANDLE haskell_handle action =
33+ -- Create a stable pointer to the Handle. This prevents the garbage collector
34+ -- getting to it while we are doing horrible manipulations with it, and hence
35+ -- stops it being finalized (and closed).
36+ withStablePtr haskell_handle $ const $ do
37+ -- Grab the write handle variable from the Handle
38+ let write_handle_mvar = case haskell_handle of
39+ FileHandle _ handle_mvar -> handle_mvar
40+ DuplexHandle _ _ handle_mvar -> handle_mvar -- This is "write" MVar, we could also take the "read" one
41+
42+ -- Get the FD from the algebraic data type
43+#if __GLASGOW_HASKELL__ < 612
44+ fd <- fmap haFD $ readMVar write_handle_mvar
45+#else
46+ --readMVar write_handle_mvar >>= \(Handle__ { haDevice = dev }) -> print (typeOf dev)
47+ Just fd <- fmap (\(Handle__ { haDevice = dev }) -> fmap fdFD (cast dev)) $ readMVar write_handle_mvar
48+#endif
49+
50+ -- Finally, turn that (C-land) FD into a HANDLE using msvcrt
51+ windows_handle <- cget_osfhandle fd
52+
53+ -- Do what the user originally wanted
54+ action windows_handle
55+
56+withStablePtr :: a -> (StablePtr a -> IO b) -> IO b
57+withStablePtr value = bracket (newStablePtr value) freeStablePtr
project-m36.cabal+87−27
@@ -35,7 +35,6 @@ Library
3535 ,filepath
3636 ,directory
3737 ,vector-binary-instances
38− ,unix
3938 ,temporary
4039 ,stm
4140 ,time
@@ -109,7 +108,12 @@ Library
109108 ProjectM36.TypeConstructorDef,
110109 Database.Persist.ProjectM36
111110 GHC-Options: -Wall -rtsopts
112− C-sources: ProjectM36/DirectoryFsync.c
111+ if os(windows)
112+ Build-Depends: Win32 >= 2.3 && < 2.4
113+ Other-Modules: ProjectM36.Win32Handle
114+ else
115+ C-sources: ProjectM36/DirectoryFsync.c
116+ Build-Depends: unix
113117 Default-Language: Haskell2010
114118
115119Executable tutd
@@ -137,7 +141,6 @@ Executable tutd
137141 deepseq,
138142 binary,
139143 data-interval,
140− unix,
141144 parallel,
142145 cassava,
143146 gnuplot,
@@ -207,8 +210,14 @@ Executable tutd
207210 TutorialD.Interpreter.Types
208211 main-is: TutorialD/tutd.hs
209212 GHC-Options: -Wall
210− C-sources: ProjectM36/DirectoryFsync.c
211213 Default-Language: Haskell2010
214+ if os(windows)
215+ Build-Depends: Win32 >= 2.3 && < 2.4
216+ Other-Modules: ProjectM36.Win32Handle
217+ else
218+ C-sources: ProjectM36/DirectoryFsync.c
219+ Build-Depends: unix
220+
212221
213222Executable project-m36-server
214223 Build-Depends: base,
@@ -222,7 +231,6 @@ Executable project-m36-server
222231 binary,
223232 transformers,
224233 temporary,
225− unix,
226234 data-interval,
227235 deepseq,
228236 uuid,
@@ -249,7 +257,6 @@ Executable project-m36-server
249257 Main-Is: ProjectM36/Server/project-m36-server.hs
250258 GHC-Options: -Wall -threaded -rtsopts
251259 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
252− C-sources: ProjectM36/DirectoryFsync.c
253260 Default-Language: Haskell2010
254261 Other-Modules: ProjectM36.Atom,
255262 ProjectM36.AtomFunction,
@@ -290,10 +297,17 @@ Executable project-m36-server
290297 ProjectM36.TupleSet,
291298 ProjectM36.TypeConstructor,
292299 ProjectM36.TypeConstructorDef
300+ if os(windows)
301+ Build-Depends: Win32 >= 2.3 && < 2.4
302+ Other-Modules: ProjectM36.Win32Handle
303+ else
304+ C-sources: ProjectM36/DirectoryFsync.c
305+ Build-Depends: unix
306+
293307
294308Executable bigrel
295309 Default-Language: Haskell2010
296− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t
310+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t
297311 Other-Modules: ProjectM36.Base,
298312 ProjectM36.Relation
299313 ProjectM36.Tuple,
@@ -330,88 +344,119 @@ Executable bigrel
330344 main-is: benchmark/bigrel.hs
331345 GHC-Options: -Wall -threaded -rtsopts
332346 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
333− C-sources: ProjectM36/DirectoryFsync.c
347+ if os(windows)
348+ Build-Depends: Win32 >= 2.3 && < 2.4
349+ Other-Modules: ProjectM36.Win32Handle
350+ else
351+ C-sources: ProjectM36/DirectoryFsync.c
352+ Build-Depends: unix
353+
334354
335355Test-Suite test-tutoriald
336356 Default-Language: Haskell2010
337357 type: exitcode-stdio-1.0
338358 main-is: test/TutorialD/Interpreter.hs
339− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t
359+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t
340360 GHC-Options: -Wall
341− C-sources: ProjectM36/DirectoryFsync.c
361+ if os(windows)
362+ Build-Depends: Win32 >= 2.3 && < 2.4
363+ Other-Modules: ProjectM36.Win32Handle
364+ else
365+ C-sources: ProjectM36/DirectoryFsync.c
366+ Build-Depends: unix
367+
342368
343369Test-Suite test-relation
344370 Default-Language: Haskell2010
345371 type: exitcode-stdio-1.0
346372 main-is: test/Relation/Basic.hs
347− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
373+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
348374 GHC-Options: -Wall
349375
350376Test-Suite test-static-optimizer
351377 Default-Language: Haskell2010
352378 type: exitcode-stdio-1.0
353379 main-is: test/Relation/StaticOptimizer.hs
354− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
380+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
355381 GHC-Options: -Wall
356382
357383Test-Suite test-transactiongraph-persist
358384 Default-Language: Haskell2010
359385 type: exitcode-stdio-1.0
360386 main-is: test/TransactionGraph/Persist.hs
361− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
387+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
362388 GHC-Options: -Wall
363− C-sources: ProjectM36/DirectoryFsync.c
389+ if os(windows)
390+ Build-Depends: Win32 >= 2.3 && < 2.4
391+ Other-Modules: ProjectM36.Win32Handle
392+ else
393+ C-sources: ProjectM36/DirectoryFsync.c
394+ Build-Depends: unix
395+
364396
365397Test-Suite test-relation-import-csv
366398 Default-Language: Haskell2010
367399 type: exitcode-stdio-1.0
368400 main-is: test/Relation/Import/CSV.hs
369− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
401+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
370402 GHC-Options: -Wall
371403
372404Test-Suite test-tutoriald-import-tutoriald
373405 Default-Language: Haskell2010
374406 type: exitcode-stdio-1.0
375407 main-is: test/TutorialD/Interpreter/Import/TutorialD.hs
376− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
408+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
377409 GHC-Options: -Wall
378410
379411Test-Suite test-relation-export-csv
380412 Default-Language: Haskell2010
381413 type: exitcode-stdio-1.0
382414 main-is: test/Relation/Export/CSV.hs
383− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
415+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
384416 GHC-Options: -Wall
385417
386418Test-Suite test-persistent-driver
387419 Default-Language: Haskell2010
388420 type: exitcode-stdio-1.0
389421 main-is: test/persistent-driver/test.hs
390− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, template-haskell, transformers, aeson, persistent-template, conduit, persistent, either, path-pieces, http-api-data, stm-containers, list-t
422+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, template-haskell, transformers, aeson, persistent-template, conduit, persistent, either, path-pieces, http-api-data, stm-containers, list-t
391423 GHC-Options: -Wall
392− C-sources: ProjectM36/DirectoryFsync.c
424+ if os(windows)
425+ Build-Depends: Win32 >= 2.3 && < 2.4
426+ Other-Modules: ProjectM36.Win32Handle
427+ else
428+ C-sources: ProjectM36/DirectoryFsync.c
429+ Build-Depends: unix
430+
431+
393432
394433benchmark bench
395434 Default-Language: Haskell2010
396435 type: exitcode-stdio-1.0
397436 main-is: benchmark/Relation.hs
398− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, criterion, stm-containers
437+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, criterion, stm-containers
399438 GHC-Options: -Wall -rtsopts
400439
401440Test-Suite test-server
402441 Default-Language: Haskell2010
403442 type: exitcode-stdio-1.0
404443 main-is: test/Server/Main.hs
405− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
444+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
406445 GHC-Options: -Wall
407− C-sources: ProjectM36/DirectoryFsync.c
446+ if os(windows)
447+ Build-Depends: Win32 >= 2.3 && < 2.4
448+ Other-Modules: ProjectM36.Win32Handle
449+ else
450+ C-sources: ProjectM36/DirectoryFsync.c
451+ Build-Depends: unix
452+
453+
408454
409455Executable Example-SimpleClient
410456 Default-Language: Haskell2010
411− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
457+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
412458 Main-Is: examples/SimpleClient.hs
413459 GHC-Options: -Wall
414− C-sources: ProjectM36/DirectoryFsync.c
415460 Other-Modules: ProjectM36.Atom,
416461 ProjectM36.AtomFunction,
417462 ProjectM36.AtomFunctions.Basic,
@@ -448,13 +493,20 @@ Executable Example-SimpleClient
448493 ProjectM36.TupleSet,
449494 ProjectM36.TypeConstructor,
450495 ProjectM36.TypeConstructorDef
496+ if os(windows)
497+ Build-Depends: Win32 >= 2.3 && < 2.4
498+ Other-Modules: ProjectM36.Win32Handle
499+ else
500+ C-sources: ProjectM36/DirectoryFsync.c
501+ Build-Depends: unix
502+
503+
451504
452505Executable Example-PersistClient
453506 Default-Language: Haskell2010
454− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template
507+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template
455508 Main-Is: examples/PersistClient.hs
456509 GHC-Options: -Wall
457− C-sources: ProjectM36/DirectoryFsync.c
458510 Other-Modules: Database.Persist.ProjectM36,
459511 ProjectM36.Atom,
460512 ProjectM36.AtomFunction,
@@ -490,4 +542,12 @@ Executable Example-PersistClient
490542 ProjectM36.Tuple,
491543 ProjectM36.TupleSet,
492544 ProjectM36.TypeConstructor,
493− ProjectM36.TypeConstructorDef
545+ ProjectM36.TypeConstructorDef
546+ if os(windows)
547+ Build-Depends: Win32 >= 2.3 && < 2.4
548+ Other-Modules: ProjectM36.Win32Handle
549+ else
550+ C-sources: ProjectM36/DirectoryFsync.c
551+ Build-Depends: unix
552+
553+