Skip to content

Commit

Permalink
Build fix for iOS; fixes #7759
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Ian Lynagh committed Apr 21, 2013
1 parent 31153f1 commit 93a4bda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions GHC/Event/KQueue.hsc
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cbits/DarwinUtils.c
@@ -1,6 +1,7 @@
#include "HsBase.h"

#ifdef darwin_HOST_OS
#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
#include <mach/mach_time.h>

static double scaling_factor = 0.0;

Expand Down

0 comments on commit 93a4bda

Please sign in to comment.