kqueue 0.1.2.6 → 0.2
raw patch · 3 files changed
+22/−11 lines, 3 filesdep ~basedep ~filepathdep ~time
Dependency ranges changed: base, filepath, time
Files
- CHANGELOG.md +5/−0
- kqueue.cabal +4/−4
- src/System/KQueue.chs +13/−7
CHANGELOG.md view
@@ -1,3 +1,8 @@+## 0.2++* Remove NoteReap. This fixes compilation on newer versions of OS X.+* Allow GHC 7.10 and 8.0+ #### 0.1.2.6 * Allow mtl 2.2.*
kqueue.cabal view
@@ -1,5 +1,5 @@ Name: kqueue-Version: 0.1.2.6+Version: 0.2 Synopsis: A binding to the kqueue event library. Description: A low-level binding to the kqueue library as found in BSD and Mac OS X. It provides, among@@ -21,11 +21,11 @@ Hs-Source-Dirs: src Exposed-modules: System.KQueue System.KQueue.HighLevel- Build-depends: base >= 4.0 && < 4.8+ Build-depends: base >= 4.0 && < 4.10 , directory >= 1.0 && < 1.4- , filepath >= 1.1 && < 1.4+ , filepath >= 1.1 && < 1.5 , mtl >= 1.1 && < 2.3- , time >= 1.1 && < 1.5+ , time >= 1.1 && < 1.7 , unix >= 2.3 && < 2.8 Build-tools: c2hs GHC-Options: -Wall
src/System/KQueue.chs view
@@ -22,7 +22,9 @@ #include <sys/time.h> #include <sys/event.h> +#if __GLASGOW_HASKELL__ <= 708 import Control.Applicative ( (<$>), (<*>) )+#endif import Control.Exception ( Exception, throwIO ) import Data.List ( foldl' ) import Data.Maybe ( mapMaybe )@@ -33,24 +35,28 @@ , Storable (..) , allocaArray , bit- , bitSize+ , finiteBitSize , maybeWith , testBit , peekArray , with , withArray )-#if __GLASGOW_HASKELL__ >= 704++#if __GLASGOW_HASKELL__ >= 710 import Foreign.C ( CInt (..) )+#elif __GLASGOW_HASKELL__ >= 704+import Foreign.C ( CInt (..)+ , CShort+ , CUInt+ , CUShort+ ) #else import Foreign.C ( CInt ) #endif import Foreign.C ( CLong- , CShort , CTime- , CUInt , CULong- , CUShort ) -- | A kernel event queue.@@ -123,7 +129,7 @@ , NoteFork = NOTE_FORK , NoteExec = NOTE_EXEC , NoteSignal = NOTE_SIGNAL- , NoteReap = NOTE_REAP+// , NoteReap = NOTE_REAP }; #endc @@ -138,7 +144,7 @@ -- | Convert an integer to a list of enumeration values by testing -- each bit, and if set, convert it to an enumeration member. bitmaskToEnum :: Enum a => Int -> [a]-bitmaskToEnum bm = mapMaybe maybeBit [0 .. bitSize bm - 1]+bitmaskToEnum bm = mapMaybe maybeBit [0 .. finiteBitSize bm - 1] where maybeBit b | testBit bm b = Just . toEnum . bit $ b | otherwise = Nothing