Skip to content

Commit

Permalink
multithread_plugin.c: add missing definitions for systems without poll.h
Browse files Browse the repository at this point in the history
Change-Id: I43cbf61ac8fb6abd5051bece190eb2a330e59f3c
Reviewed-on: http://review.couchbase.org/23214
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
  • Loading branch information
avsej committed Dec 11, 2012
1 parent fdd7ffd commit f4ab166
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/couchbase_ext/multithread_plugin.c
Expand Up @@ -791,6 +791,15 @@ loop_select_cleanup(VALUE argp)
#define POLLOUT_SET (POLLOUT | POLLHUP | POLLERR)

#ifndef HAVE_PPOLL
#if SIZEOF_TIME_T == SIZEOF_LONG
typedef unsigned long unsigned_time_t;
#elif SIZEOF_TIME_T == SIZEOF_INT
typedef unsigned int unsigned_time_t;
#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
typedef unsigned LONG_LONG unsigned_time_t;
#else
# error cannot find integer type which size is same as time_t.
#endif
#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
static int
ppoll(struct pollfd *fds, nfds_t nfds,
Expand Down

0 comments on commit f4ab166

Please sign in to comment.