projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5caacc9
)
Work around a limitation in the hsc2hs cross-compilation mode
author
Ian Lynagh
<igloo@earth.li>
Wed, 23 Mar 2011 23:49:06 +0000
(23:49 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Wed, 23 Mar 2011 23:49:06 +0000
(23:49 +0000)
GHC/Event/Poll.hsc
patch
|
blob
|
history
diff --git
a/GHC/Event/Poll.hsc
b/GHC/Event/Poll.hsc
index
82acc62
..
e34b47e
100644
(file)
--- a/
GHC/Event/Poll.hsc
+++ b/
GHC/Event/Poll.hsc
@@
-107,15
+107,24
@@
data PollFd = PollFd {
newtype Event = Event CShort
deriving (Eq, Show, Num, Storable, Bits)
newtype Event = Event CShort
deriving (Eq, Show, Num, Storable, Bits)
+-- We have to duplicate the whole enum like this in order for the
+-- hsc2hs cross-compilation mode to work
+#ifdef POLLRDHUP
#{enum Event, Event
, pollIn = POLLIN
, pollOut = POLLOUT
#{enum Event, Event
, pollIn = POLLIN
, pollOut = POLLOUT
-#ifdef POLLRDHUP
, pollRdHup = POLLRDHUP
, pollRdHup = POLLRDHUP
-#endif
, pollErr = POLLERR
, pollHup = POLLHUP
}
, pollErr = POLLERR
, pollHup = POLLHUP
}
+#else
+#{enum Event, Event
+ , pollIn = POLLIN
+ , pollOut = POLLOUT
+ , pollErr = POLLERR
+ , pollHup = POLLHUP
+ }
+#endif
fromEvent :: E.Event -> Event
fromEvent e = remap E.evtRead pollIn .|.
fromEvent :: E.Event -> Event
fromEvent e = remap E.evtRead pollIn .|.