remove support for building with older Win32
authorJoey Hess <joeyh@joeyh.name>
Wed, 2 Aug 2023 15:59:57 +0000 (11:59 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 2 Aug 2023 15:59:57 +0000 (11:59 -0400)
No need to preserve this since the cabal file depends on the newer one.

Utility/LockFile/Windows.hs

index 2ab521e438c525afe50a5f698732149cc2a7a6f6..64a8ab86d0b0bc0fdd85ef035ed67cff23710007 100644 (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