Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
4aa8bc19
Commit
4aa8bc19
authored
Sep 16, 2012
by
iquiw
Committed by
Simon Marlow
Oct 04, 2012
Browse files
Adapt to NetBSD's struct kevent
parent
0978d640
Changes
3
Hide whitespace changes
Inline
Side-by-side
libraries/base/GHC/Event/KQueue.hsc
View file @
4aa8bc19
...
...
@@ -50,6 +50,8 @@ import qualified GHC.Event.Array as A
#if defined(HAVE_KEVENT64)
import Data.Int (Int64)
import Data.Word (Word64)
#elif defined(netbsd_HOST_OS)
import Data.Int (Int64)
#endif
#include <sys/types.h>
...
...
@@ -172,7 +174,11 @@ data Event = KEvent {
, filter :: {-# UNPACK #-} !Filter
, flags :: {-# UNPACK #-} !Flag
, fflags :: {-# UNPACK #-} !FFlag
#ifdef netbsd_HOST_OS
, data_ :: {-# UNPACK #-} !Int64
#else
, data_ :: {-# UNPACK #-} !CIntPtr
#endif
, udata :: {-# UNPACK #-} !(Ptr ())
} deriving Show
...
...
@@ -210,7 +216,11 @@ newtype FFlag = FFlag Word32
, noteEOF = NOTE_EOF
}
#if SIZEOF_KEV_FLAGS == 4 /* kevent.flag: uint32_t or uint16_t. */
newtype Flag = Flag Word32
#else
newtype Flag = Flag Word16
#endif
deriving (Eq, Show, Storable)
#{enum Flag, Flag
...
...
@@ -218,7 +228,11 @@ newtype Flag = Flag Word16
, flagDelete = EV_DELETE
}
#if SIZEOF_KEV_FILTER == 4 /*kevent.filter: uint32_t or uint16_t. */
newtype Filter = Filter Word32
#else
newtype Filter = Filter Word16
#endif
deriving (Bits, Eq, Num, Show, Storable)
#{enum Filter, Filter
...
...
libraries/base/configure.ac
View file @
4aa8bc19
...
...
@@ -51,6 +51,12 @@ fi
if test "$ac_cv_header_sys_event_h" = yes -a "$ac_cv_func_kqueue" = yes; then
AC_DEFINE([HAVE_KQUEUE], [1], [Define if you have kqueue support.])
AC_CHECK_SIZEOF([kev.filter], [], [#include <sys/event.h>
struct kevent kev;])
AC_CHECK_SIZEOF([kev.flags], [], [#include <sys/event.h>
struct kevent kev;])
fi
if test "$ac_cv_header_poll_h" = yes -a "$ac_cv_func_poll" = yes; then
...
...
libraries/base/include/EventConfig.h.in
View file @
4aa8bc19
...
...
@@ -83,3 +83,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* The size of `kev.filter', as computed by sizeof. */
#undef SIZEOF_KEV_FILTER
/* The size of `kev.flags', as computed by sizeof. */
#undef SIZEOF_KEV_FLAGS
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment