Skip to content

Commit

Permalink
Drop use of NegativeLiterals (fixes #118) (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistuke authored Nov 28, 2018
1 parent ee48f4a commit 60cbcea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Graphics/Win32/Window.hsc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE NegativeLiterals #-}
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
Expand Down Expand Up @@ -682,7 +681,7 @@ allocaMessage = allocaBytes #{size MSG}

getMessage :: LPMSG -> Maybe HWND -> IO Bool
getMessage msg mb_wnd = do
res <- failIf (== -1) "GetMessage" $
res <- failIf (== maxBound) "GetMessage" $
c_GetMessage msg (maybePtr mb_wnd) 0 0
return (res /= 0)
foreign import WINDOWS_CCONV "windows.h GetMessageW"
Expand All @@ -694,7 +693,7 @@ foreign import WINDOWS_CCONV "windows.h GetMessageW"

peekMessage :: LPMSG -> Maybe HWND -> UINT -> UINT -> UINT -> IO ()
peekMessage msg mb_wnd filterMin filterMax remove = do
failIf_ (== -1) "PeekMessage" $
failIf_ (== maxBound) "PeekMessage" $
c_PeekMessage msg (maybePtr mb_wnd) filterMin filterMax remove
foreign import WINDOWS_CCONV "windows.h PeekMessageW"
c_PeekMessage :: LPMSG -> HWND -> UINT -> UINT -> UINT -> IO LONG
Expand Down
2 changes: 1 addition & 1 deletion Win32.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Win32
version: 2.8.1.0
version: 2.8.2.0
license: BSD3
license-file: LICENSE
author: Alastair Reid, shelarcy, Tamar Christina
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for [`Win32` package](http://hackage.haskell.org/package/Win32)

## 2.8.2.0 *Dec 2018*

* Drop use of NegativeLiterals (See #118)

## 2.8.1.0 *Nov 2018*

* Fix broken links (See #116)
Expand Down

2 comments on commit 60cbcea

@Mistuke
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Win32 Bindings for Haskell / Win32 Continuous builds Build 72 is now running

@Mistuke
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Win32 Bindings for Haskell / Win32 Continuous builds Build 72 outcome was SUCCESS
Summary: Running Build time: 00:08:25

Please sign in to comment.