#include <sys/epoll.h>
#endif
-#include "dropin.h"
#include "event.h"
#include "utils.h"
#include "net.h"
struct timeval now;
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
#ifdef HAVE_SYS_EPOLL_H
static int epollset = 0;
#endif
static int io_compare(const io_t *a, const io_t *b) {
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
return a->fd - b->fd;
#else
}
io->fd = fd;
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
if(io->fd != -1) {
io->event = WSACreateEvent();
#endif
}
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
void io_add_event(io_t *io, io_cb_t cb, void *data, WSAEVENT event) {
io->event = event;
io_add(io, cb, data, -1, 0);
return;
}
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
#ifdef HAVE_SYS_EPOLL_H
epoll_ctl(epollset, EPOLL_CTL_DEL, io->fd, NULL);
}
io_set(io, 0);
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
if(io->fd != -1 && WSACloseEvent(io->event) == FALSE) {
abort();
io->cb = NULL;
}
-void timeout_add(timeout_t *timeout, timeout_cb_t cb, void *data, struct timeval *tv) {
+void timeout_add(timeout_t *timeout, timeout_cb_t cb, void *data, const struct timeval *tv) {
timeout->cb = cb;
timeout->data = data;
timeout->node.data = timeout;
timeout_set(timeout, tv);
}
-void timeout_set(timeout_t *timeout, struct timeval *tv) {
+void timeout_set(timeout_t *timeout, const struct timeval *tv) {
if(timerisset(&timeout->tv)) {
splay_unlink_node(&timeout_tree, &timeout->node);
}
};
}
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
// From Matz's Ruby
#ifndef NSIG
bool event_loop(void) {
running = true;
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
#ifdef HAVE_SYS_EPOLL_H