packages feed

unix-compat 0.1.1 → 0.1.2.0

raw patch · 6 files changed

+62/−23 lines, 6 filesdep +directorydep +old-timedep ~basedep ~unix

Dependencies added: directory, old-time

Dependency ranges changed: base, unix

Files

System/PosixCompat/Extensions.hsc view
@@ -5,10 +5,13 @@          deviceMajor, deviceMinor, makeDeviceID    ) where ++#if UNIX_IMPL #include "HsUnixCompat.h"+#endif  import Foreign.C.Types-import System.Posix.Types+import System.PosixCompat.Types   type CMajor = CUInt
System/PosixCompat/Files.hsc view
@@ -59,14 +59,14 @@     PathVar(..), getPathVar, getFdPathVar,  ) where -#include "HsUnixCompat.h"- #if UNIX_IMPL +#include "HsUnixCompat.h"+ import System.Posix.Files  #if NEED_setSymbolicLinkOwnerAndGroup-import System.Posix.Types+import System.PosixCompat.Types #endif  #else /* Portable implementation */@@ -79,7 +79,7 @@                          getModificationTime) import System.IO (IOMode(..), openFile, hFileSize, hSetFileSize, hClose) import System.IO.Error-import System.Posix.Types+import System.PosixCompat.Types import System.Time (ClockTime(..), getClockTime)  #if __GLASGOW_HASKELL__
+ System/PosixCompat/Types.hs view
@@ -0,0 +1,32 @@+module System.PosixCompat.Types (+  module System.Posix.Types,+#ifndef UNIX_IMPL+  UserID, GroupID, LinkCount+#endif+  ) where++import System.Posix.Types++#ifndef UNIX_IMPL++import Data.Word (Word32)++newtype UserID = UserID Word32+  deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)+instance Show UserID where show (UserID x) = show x+instance Read UserID where readsPrec i s = [ (UserID x, s')+                                           | (x,s') <- readsPrec i s]++newtype GroupID = GroupID Word32+  deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)+instance Show GroupID where show (GroupID x) = show x+instance Read GroupID where readsPrec i s = [ (GroupID x, s')+                                            | (x,s') <- readsPrec i s]++newtype LinkCount = LinkCount Word32+  deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)+instance Show LinkCount where show (LinkCount x) = show x+instance Read LinkCount where readsPrec i s = [ (LinkCount x, s')+                                              | (x,s') <- readsPrec i s]++#endif
System/PosixCompat/User.hsc view
@@ -26,16 +26,16 @@     setGroupID   ) where -#include "HsUnixCompat.h"- #if UNIX_IMPL +#include "HsUnixCompat.h"+ import System.Posix.User  #else /* Portable implementation */  import System.IO.Error-import System.Posix.Types+import System.PosixCompat.Types  #endif 
include/HsUnixCompat.h view
@@ -1,6 +1,3 @@-#define UNIX_IMPL !defined(mingw32_HOST_OS)--#if UNIX_IMPL #include "HsUnix.h" #include <sys/types.h> @@ -9,6 +6,3 @@ dev_t unix_makedev(unsigned int maj, unsigned int min);  #define NEED_setSymbolicLinkOwnerAndGroup !HAVE_LCHOWN--#endif-
unix-compat.cabal view
@@ -1,6 +1,6 @@ Name: unix-compat-Version: 0.1.1-Cabal-version: >= 1.2+Version: 0.1.2.0+Cabal-version: >= 1.2.1 Build-type: Simple License: BSD4 License-file: LICENSE@@ -11,20 +11,30 @@   of the unix package. This package re-exports the unix    package when available. When it isn't available,   portable implementations are used.-Extra-source-files: include/HsUnixCompat.h +Flag split-base+ Library   Exposed-modules:     System.PosixCompat.Extensions     System.PosixCompat.Files     System.PosixCompat.User-  Extensions: CPP, ForeignFunctionInterface-  Include-dirs: include-  Includes: HsUnixCompat.h-  Install-includes: HsUnixCompat.h-  C-sources: cbits/HsUnixCompat.c+    System.PosixCompat.Types+  Extensions: CPP   GHC-Options: -Wall   Build-depends: base -  if !os(mingw32)+  if os(windows)+    if flag(split-base)+      Build-depends: base >= 3, old-time, directory+    else+      Build-depends: base < 3+    Extensions: GeneralizedNewtypeDeriving+  else     Build-depends: unix+    Extensions: ForeignFunctionInterface+    CPP-options: -DUNIX_IMPL+    Include-dirs: include+    Includes: HsUnixCompat.h+    Install-includes: HsUnixCompat.h+    C-sources: cbits/HsUnixCompat.c