packages feed

lukko 0.1.1.3 → 0.1.2

raw patch · 5 files changed

+34/−55 lines, 5 filesdep −taggeddep ~basedep ~bytestringdep ~filepath

Dependencies removed: tagged

Dependency ranges changed: base, bytestring, filepath, singleton-bool, tasty, tasty-expected-failure

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.1.2++* Support GHC-8.6.5...9.10.1+ # 0.1.1.3  * Use `CApiFFI` to call varargs C functions.
lukko.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.2 name:               lukko-version:            0.1.1.3+version:            0.1.2 synopsis:           File locking category:           System, Concurrency description:@@ -49,15 +49,15 @@ build-type:         Simple extra-source-files: CHANGELOG.md tested-with:-  GHC ==7.6.3-   || ==7.8.4-   || ==7.10.3-   || ==8.0.2-   || ==8.2.2-   || ==8.4.4-   || ==8.6.5+  GHC ==8.6.5    || ==8.8.4-   || ==8.10.3+   || ==8.10.7+   || ==9.0.2+   || ==9.2.8+   || ==9.4.8+   || ==9.6.5+   || ==9.8.2+   || ==9.10.1  source-repository head   type:     git@@ -72,8 +72,8 @@ library   default-language:   Haskell2010   hs-source-dirs:     src-  build-depends:      base >=4.5 && <4.15-  build-tool-depends: hsc2hs:hsc2hs >=0.67 && <0.69+  build-depends:      base >=4.12.0.0 && <4.21+  build-tool-depends: hsc2hs:hsc2hs >=0.68.5 && <0.69    -- Main library module   exposed-modules:@@ -121,17 +121,14 @@   build-depends:     , async                   ^>=2.2.2     , base-    , filepath                ^>=1.3.0.0 || ^>=1.4.0.0+    , filepath                ^>=1.4.2.1  || ^>=1.5.2.0     , lukko-    , singleton-bool          ^>=0.1.5-    , tasty                   ^>=1.4.0.1-    , tasty-expected-failure  ^>=0.11.1.2 || ^>=0.12.2+    , singleton-bool          ^>=0.1.8+    , tasty                   ^>=1.5+    , tasty-expected-failure  ^>=0.12.3     , tasty-hunit             ^>=0.10.0.2     , temporary               ^>=1.3 -  if !impl(ghc >=7.8)-    build-depends: tagged ^>=0.8.5-   if os(windows)     cpp-options: -DHAS_WINDOWS_LOCK @@ -150,7 +147,7 @@   ghc-options:      -threaded   build-depends:     , base-    , bytestring  >=0.9.2.1 && <0.11+    , bytestring  >=0.10.8.2 && <0.13     , lukko    if os(windows)
src-ofd/Lukko/OFD.hsc view
@@ -35,7 +35,21 @@  #define _GNU_SOURCE #include <unistd.h>++-- Support for file description locks (F_OFD_SETLKW and F_OFD_SETLK) was added+-- to glibc in version 2.20. If we have an older version then we must get the+-- functionality directly from the linux headers.+--+-- See glibc 2.20 release notes: <https://sourceware.org/legacy-ml/libc-alpha/2014-09/msg00088.html>+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)+#if __GLIBC_PREREQ(2, 20) #include <fcntl.h>+#else+#include <linux/fcntl.h>+#endif+#else+#include <fcntl.h>+#endif  import Control.Monad (void) import System.IO (Handle)
src/Lukko/Internal/FillBytes.hs view
@@ -3,19 +3,4 @@ {-# LANGUAGE Trustworthy      #-} module Lukko.Internal.FillBytes (fillBytes) where -#if MIN_VERSION_base(4,8,0) import Foreign.Marshal.Utils (fillBytes)-#else-import Data.Word       (Word8)-import Foreign.C.Types (CInt (..), CSize (..))-import Foreign.Ptr     (Ptr (..))-#endif--#if !MIN_VERSION_base(4,8,0)-fillBytes :: Ptr a -> Word8 -> Int -> IO ()-fillBytes dest char size = do-    _ <- memset dest (fromIntegral char) (fromIntegral size)-    return ()--foreign import ccall unsafe "string.h" memset  :: Ptr a -> CInt  -> CSize -> IO (Ptr a)-#endif
src/Lukko/Internal/HandleToFD.hs view
@@ -5,28 +5,7 @@ import qualified GHC.IO.FD as GHC (FD (..)) import           System.IO (Handle) -#if MIN_VERSION_base(4,10,0) import qualified GHC.IO.Handle.FD as GHC (handleToFd)-#else-import Control.Concurrent.MVar (readMVar)-import Data.Typeable           (cast)-import GHC.IO.Exception-import GHC.IO.Handle.Internals-import GHC.IO.Handle.Types-#endif  ghcHandleToFd :: Handle -> IO GHC.FD-#if MIN_VERSION_base(4,10,0) ghcHandleToFd = GHC.handleToFd-#else-ghcHandleToFd h = case h of-    FileHandle _ mv -> do-      Handle__{haDevice = dev} <- readMVar mv-      case cast dev of-          Just fd -> return fd-          Nothing -> throwErr "not a file descriptor"-    DuplexHandle{} -> throwErr "not a file handle"-  where-    throwErr msg = ioException $ IOError (Just h)-      InappropriateType "handleToFd" msg Nothing Nothing-#endif