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:
Joey Hess 2023-08-02 11:59:57 -04:00
parent 9e2e5bc79b
commit 461330c585
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -5,7 +5,7 @@
- License: BSD-2-clause
-}
{-# LANGUAGE OverloadedStrings, CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Utility.LockFile.Windows (
lockShared,
@ -58,21 +58,12 @@ lockExclusive = openLock fILE_SHARE_NONE
openLock :: ShareMode -> LockFile -> IO (Maybe LockHandle)
openLock sharemode f = do
f' <- convertToWindowsNativeNamespace f
#if MIN_VERSION_Win32(2,13,4)
r <- tryNonAsync $ createFile_NoRetry f' gENERIC_READ sharemode
security_attributes oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
(maybePtr Nothing)
return $ case r of
Left _ -> Nothing
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
security_attributes = maybePtr Nothing