zeromq4-haskell 0.6 → 0.6.1
raw patch · 5 files changed
+24/−17 lines, 5 filesdep +ghc-prim
Dependencies added: ghc-prim
Files
- CHANGELOG.md +5/−0
- examples/Makefile +2/−2
- examples/prompt.hs +1/−2
- src/System/ZMQ4.hs +12/−12
- zeromq4-haskell.cabal +4/−1
CHANGELOG.md view
@@ -1,3 +1,8 @@+0.6.1+-----------------------------------------------------------------------------+- Bug fixes: #55+- Build fixes for GHC versions < 7.6+ 0.6 ----------------------------------------------------------------------------- - Update to `exceptions` 0.6
examples/Makefile view
@@ -1,8 +1,8 @@ all: chat chat: display.hs prompt.hs- ghc --make -threaded display.hs- ghc --make -threaded prompt.hs+ cabal exec ghc -- --make -threaded display.hs+ cabal exec ghc -- --make -threaded prompt.hs .PHONY: clean clean:
examples/prompt.hs view
@@ -7,7 +7,6 @@ import System.Exit import System.Environment import System.ZMQ4.Monadic-import qualified Data.ByteString.UTF8 as SB main :: IO () main = do@@ -21,5 +20,5 @@ pub <- socket Pub bind pub addr forever $ do- line <- liftIO $ SB.fromString <$> getLine+ line <- liftIO $ fromString <$> getLine send pub [] (name <> line)
src/System/ZMQ4.hs view
@@ -230,7 +230,7 @@ import qualified Prelude as P import qualified System.ZMQ4.Base as B -import GHC.Conc (threadWaitRead, threadWaitWrite)+import GHC.Conc (threadWaitRead) import GHC.Generics(Generic) -----------------------------------------------------------------------------@@ -948,31 +948,31 @@ retry :: String -> IO () -> IO CInt -> IO () retry msg wait act = throwIfMinus1RetryMayBlock_ msg act wait -wait' :: (Fd -> IO ()) -> ZMQPollEvent -> Socket a -> IO ()+wait' :: ZMQPollEvent -> Socket a -> IO () #ifdef mingw32_HOST_OS-wait' _ _ _ = return ()+wait' _ _ = return () #else-wait' w f s = do- fd <- getIntOpt s B.filedesc 0- w (Fd fd)- evs <- getInt32Option B.events s- unless (testev evs) $- wait' w f s+wait' p s = do+ e <- getInt32Option B.events s+ unless (testev e) $ do+ fd <- getIntOpt s B.filedesc 0+ threadWaitRead (Fd fd)+ wait' p s where- testev e = e .&. fromIntegral (pollVal f) /= 0+ testev e = e .&. fromIntegral (pollVal p) /= 0 #endif -- | Wait until data is available for reading from the given Socket. -- After this function returns, a call to 'receive' will essentially be -- non-blocking. waitRead :: Socket a -> IO ()-waitRead = wait' threadWaitRead pollIn+waitRead = wait' pollIn -- | Wait until data can be written to the given Socket. -- After this function returns, a call to 'send' will essentially be -- non-blocking. waitWrite :: Socket a -> IO ()-waitWrite = wait' threadWaitWrite pollOut+waitWrite = wait' pollOut -- | Starts built-in 0MQ proxy -- (cf. <http://api.zeromq.org/4-0:zmq-proxy zmq_proxy>)
zeromq4-haskell.cabal view
@@ -1,5 +1,5 @@ name: zeromq4-haskell-version: 0.6+version: 0.6.1 synopsis: Bindings to ZeroMQ 4.x category: System, FFI license: MIT@@ -60,6 +60,9 @@ , exceptions == 0.6.* , semigroups >= 0.8 , transformers >= 0.3++ if impl(ghc < 7.6)+ build-depends: ghc-prim == 0.3.* if os(windows) extra-libraries: zmq