packages feed

unix-compat 0.7 → 0.7.1

raw patch · 6 files changed

+50/−5 lines, 6 filesnew-uploader

Files

CHANGELOG.md view
@@ -1,6 +1,10 @@+## Version 0.7.1 (2023-12-06) Santa Clause edition++- Add `System.PosixCompat.Process` module, exporting `getProcessID`+ ## Version 0.7 (2023-03-15) -- Remote `System.PosixCompat.User` module+- Remove `System.PosixCompat.User` module  ## Version 0.6 (2022-05-22) 
src/System/PosixCompat.hs view
@@ -7,6 +7,7 @@ -} module System.PosixCompat (       module System.PosixCompat.Files+    , module System.PosixCompat.Process     , module System.PosixCompat.Temp     , module System.PosixCompat.Time     , module System.PosixCompat.Types@@ -15,6 +16,7 @@     ) where  import System.PosixCompat.Files+import System.PosixCompat.Process import System.PosixCompat.Temp import System.PosixCompat.Time import System.PosixCompat.Types
+ src/System/PosixCompat/Process.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE CPP #-}++{-|+This module intends to make the operations of @System.Posix.Process@ available+on all platforms.+-}+module System.PosixCompat.Process (+      getProcessID+    ) where++#ifdef mingw32_HOST_OS++import System.Posix.Types (ProcessID)+import System.Win32.Process (getCurrentProcessId)++getProcessID :: IO ProcessID+getProcessID = fromIntegral <$> getCurrentProcessId++#else++import System.Posix.Process++#endif
+ tests/ProcessSpec.hs view
@@ -0,0 +1,12 @@+module ProcessSpec (processSpec) where++import System.PosixCompat+import Test.HUnit+import Test.Hspec++processSpec :: Spec+processSpec = do+  describe "getProcessID" $ do+    it "should work on Windows and Unix" $ do+      pid <- getProcessID+      assert $ pid > 0
tests/main.hs view
@@ -2,6 +2,7 @@  import MkstempSpec import LinksSpec+import ProcessSpec  import Test.Hspec @@ -9,3 +10,4 @@ main = hspec $ do     mkstempSpec     linksSpec+    processSpec
unix-compat.cabal view
@@ -1,16 +1,16 @@ name:           unix-compat-version:        0.7+version:        0.7.1 synopsis:       Portable POSIX-compatibility layer. description:    This package provides portable implementations of parts                 of the unix package. This package re-exports the unix                 package when available. When it isn't available,                 portable implementations are used. -homepage:       http://github.com/haskell-pkg-janitors/unix-compat+homepage:       https://github.com/haskell-pkg-janitors/unix-compat license:        BSD3 license-file:   LICENSE author:         Björn Bringert, Duncan Coutts, Jacob Stanley, Bryan O'Sullivan-maintainer:     Mitchell Rosen <mitchellwrosen@gmail.com>+maintainer:     https://github.com/haskell-pkg-janitors category:       System build-type:     Simple cabal-version:  >= 1.10@@ -20,7 +20,7 @@  source-repository head   type:     git-  location: git@github.com:haskell-pkg-janitors/unix-compat.git+  location: https://github.com/haskell-pkg-janitors/unix-compat.git  flag old-time   description: build against old-time package@@ -36,6 +36,7 @@     System.PosixCompat     System.PosixCompat.Extensions     System.PosixCompat.Files+    System.PosixCompat.Process     System.PosixCompat.Temp     System.PosixCompat.Time     System.PosixCompat.Types@@ -85,6 +86,7 @@   other-modules:      MkstempSpec      LinksSpec+     ProcessSpec    -- ghc-options:   --   -Wall