summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Event
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-04-21 18:07:58 +0100
committerIan Lynagh <ian@well-typed.com>2013-04-21 18:07:58 +0100
commit7fadc60f8873af1436c0dfa88b071188d9da9bce (patch)
treef042afb9fc1dddb85f242706e9324379fb254614 /libraries/base/GHC/Event
parent7a3131ecdd50a5dfebb3a4e1ee26bd0697e17479 (diff)
downloadhaskell-7fadc60f8873af1436c0dfa88b071188d9da9bce.tar.gz
Build fix for iOS; fixes #7759
Patch from Stephen Blackheath. The issue here is that the #defines EVFILT_READ and EVFILT_WRITE have the values -1 and -2. The original code translates that to filterRead = Filter -1 which is wrong Haskell and fails to compile. The modified code produces the correct code filterRead = Filter (-1)
Diffstat (limited to 'libraries/base/GHC/Event')
-rw-r--r--libraries/base/GHC/Event/KQueue.hsc8
1 files changed, 4 insertions, 4 deletions
diff --git a/libraries/base/GHC/Event/KQueue.hsc b/libraries/base/GHC/Event/KQueue.hsc
index d157f6464e..fc1d679a39 100644
--- a/libraries/base/GHC/Event/KQueue.hsc
+++ b/libraries/base/GHC/Event/KQueue.hsc
@@ -197,10 +197,10 @@ newtype Filter = Filter Word16
#endif
deriving (Bits, Eq, Num, Show, Storable)
-#{enum Filter, Filter
- , filterRead = EVFILT_READ
- , filterWrite = EVFILT_WRITE
- }
+filterRead :: Filter
+filterRead = Filter (#const EVFILT_READ)
+filterWrite :: Filter
+filterWrite = Filter (#const EVFILT_WRITE)
data TimeSpec = TimeSpec {
tv_sec :: {-# UNPACK #-} !CTime