sysinfo 0.1.0.0 → 0.1.1
raw patch · 3 files changed
+21/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +7/−0
- src/System/SysInfo.hsc +10/−0
- sysinfo.cabal +4/−2
+ CHANGELOG.md view
@@ -0,0 +1,7 @@+# Version 0.1.1++* Make it compile on non Linux platforms++# Version 0.1.0.0++* Initial version released
src/System/SysInfo.hsc view
@@ -1,3 +1,4 @@+{-#LANGUAGE CPP#-} {-#LANGUAGE ForeignFunctionInterface#-} {-#LANGUAGE ScopedTypeVariables#-} {-#LANGUAGE RecordWildCards#-}@@ -13,7 +14,9 @@ , Loads(..) ) where +#ifndef NO_SYSINFO #include <sys/sysinfo.h>+#endif import Foreign.C import Foreign.Ptr@@ -68,6 +71,7 @@ (ptr' :: Ptr CULong) = castPtr ptr index = [0, 1, 2] +#ifndef NO_SYSINFO instance Storable SysInfo where sizeOf _ = (#size struct sysinfo) alignment _ = (#alignment struct sysinfo)@@ -120,3 +124,9 @@ free sptr err <- getErrno return $ Left err+#else+-- | Functor for getting system information. On non-Linux sytems always fails+-- with @E_NODATA@.+sysInfo :: IO (Either Errno SysInfo)+sysInfo = return (Left eNODATA)+#endif
sysinfo.cabal view
@@ -1,5 +1,5 @@ name: sysinfo-version: 0.1.0.0+version: 0.1.1 synopsis: Haskell Interface for getting overall system statistics description: This package can be used to get system statistics like uptime, free memory, system load etc. Note that@@ -13,7 +13,7 @@ copyright: Copyright: (c) 2017 Sibi category: FFI, Linux, System build-type: Simple-extra-source-files: README.md+extra-source-files: README.md, CHANGELOG.md cabal-version: >=1.10 library@@ -21,6 +21,8 @@ exposed-modules: System.SysInfo build-depends: base >= 4.7 && < 5 default-language: Haskell2010+ if !os(linux)+ cpp-options: -DNO_SYSINFO test-suite sysinfo-test type: exitcode-stdio-1.0