diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-06-06 21:32:29 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-06-06 21:32:29 +0200 |
commit | 72ba95873a6d99def07a4bfecda44fb942165142 (patch) | |
tree | 4bcb11afc568c4894f4cb109d57c14968320a58b /sql/threadpool_unix.cc | |
parent | fab9a55d077b4f2a511b273d5f51272f1e3dc1ff (diff) | |
parent | 4749d40c635634e25e07d28ce1a04e9263bcc375 (diff) | |
download | mariadb-git-72ba95873a6d99def07a4bfecda44fb942165142.tar.gz |
10.0-base merge
(without InnoDB - all InnoDB changes were ignored)
Diffstat (limited to 'sql/threadpool_unix.cc')
-rw-r--r-- | sql/threadpool_unix.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index 69df00a2c9a..658a04d877e 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -286,6 +286,20 @@ static void *native_event_get_userdata(native_event *event) } #elif defined(HAVE_KQUEUE) + +/* + NetBSD is incompatible with other BSDs , last parameter in EV_SET macro + (udata, user data) needs to be intptr_t, whereas it needs to be void* + everywhere else. +*/ + +#ifdef __NetBSD__ +#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, (intptr_t)g) +#else +#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, g) +#endif + + int io_poll_create() { return kqueue(); @@ -294,7 +308,7 @@ int io_poll_create() int io_poll_start_read(int pollfd, int fd, void *data) { struct kevent ke; - EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT, + MY_EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT, 0, 0, data); return kevent(pollfd, &ke, 1, 0, 0, 0); } @@ -303,7 +317,7 @@ int io_poll_start_read(int pollfd, int fd, void *data) int io_poll_associate_fd(int pollfd, int fd, void *data) { struct kevent ke; - EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT, + MY_EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT, 0, 0, data); return io_poll_start_read(pollfd,fd, data); } @@ -312,7 +326,7 @@ int io_poll_associate_fd(int pollfd, int fd, void *data) int io_poll_disassociate_fd(int pollfd, int fd) { struct kevent ke; - EV_SET(&ke,fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + MY_EV_SET(&ke,fd, EVFILT_READ, EV_DELETE, 0, 0, 0); return kevent(pollfd, &ke, 1, 0, 0, 0); } @@ -337,7 +351,7 @@ int io_poll_wait(int pollfd, struct kevent *events, int maxevents, int timeout_m static void* native_event_get_userdata(native_event *event) { - return event->udata; + return (void *)event->udata; } #elif defined (__sun) |