remove support for building with older Win32
No need to preserve this since the cabal file depends on the newer one.
This commit is contained in:
parent
9e2e5bc79b
commit
461330c585
1 changed files with 1 additions and 10 deletions
|
@ -5,7 +5,7 @@
|
||||||
- License: BSD-2-clause
|
- License: BSD-2-clause
|
||||||
-}
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE OverloadedStrings, CPP #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
|
||||||
module Utility.LockFile.Windows (
|
module Utility.LockFile.Windows (
|
||||||
lockShared,
|
lockShared,
|
||||||
|
@ -58,21 +58,12 @@ lockExclusive = openLock fILE_SHARE_NONE
|
||||||
openLock :: ShareMode -> LockFile -> IO (Maybe LockHandle)
|
openLock :: ShareMode -> LockFile -> IO (Maybe LockHandle)
|
||||||
openLock sharemode f = do
|
openLock sharemode f = do
|
||||||
f' <- convertToWindowsNativeNamespace f
|
f' <- convertToWindowsNativeNamespace f
|
||||||
#if MIN_VERSION_Win32(2,13,4)
|
|
||||||
r <- tryNonAsync $ createFile_NoRetry f' gENERIC_READ sharemode
|
r <- tryNonAsync $ createFile_NoRetry f' gENERIC_READ sharemode
|
||||||
security_attributes oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
|
security_attributes oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
|
||||||
(maybePtr Nothing)
|
(maybePtr Nothing)
|
||||||
return $ case r of
|
return $ case r of
|
||||||
Left _ -> Nothing
|
Left _ -> Nothing
|
||||||
Right h -> Just h
|
Right h -> Just h
|
||||||
#else
|
|
||||||
h <- withTString (fromRawFilePath f') $ \c_f ->
|
|
||||||
c_CreateFile c_f gENERIC_READ sharemode security_attributes
|
|
||||||
oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL (maybePtr Nothing)
|
|
||||||
return $ if h == iNVALID_HANDLE_VALUE
|
|
||||||
then Nothing
|
|
||||||
else Just h
|
|
||||||
#endif
|
|
||||||
where
|
where
|
||||||
security_attributes = maybePtr Nothing
|
security_attributes = maybePtr Nothing
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue