From c1404b56514813d6be881702bd6efcee2e98ee8d Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Wed, 26 Aug 2015 10:06:09 +0200 Subject: [PATCH 1/3] Include , and optionally. Though CloudABI implements a very large part of POSIX, it does not provide these header files, for the reason that there is no raw device access, no resource limiting and no access to the global process table through wait(). It looks like these header files are not actually needed in theory. There don't seem to be any constructs in these source files that use these features, but I suspect they might still be required on some systems. --- event_tagging.c | 5 +++-- http.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/event_tagging.c b/event_tagging.c index 64b100b8..6459dfa7 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -40,10 +40,11 @@ #include #include #undef WIN32_LEAN_AND_MEAN -#else -#include #endif +#ifdef EVENT__HAVE_SYS_IOCTL_H +#include +#endif #include #ifdef EVENT__HAVE_SYS_TIME_H #include diff --git a/http.c b/http.c index 99308b39..75b902dc 100644 --- a/http.c +++ b/http.c @@ -35,18 +35,22 @@ #include #endif -#ifdef EVENT__HAVE_SYS_TIME_H -#include -#endif #ifdef HAVE_SYS_IOCCOM_H #include #endif +#ifdef EVENT__HAVE_SYS_RESOURCE_H +#include +#endif +#ifdef EVENT__HAVE_SYS_TIME_H +#include +#endif +#ifdef EVENT__HAVE_SYS_WAIT_H +#include +#endif #ifndef _WIN32 -#include #include #include -#include #else #include #include From b2c68bc22b43d242744ea52da4f6606cd2c736cf Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Wed, 26 Aug 2015 09:45:23 +0200 Subject: [PATCH 2/3] Add missing include of . POSIX states that sockaddr_in6 should be declared in . By including this header, the code now builds on FreeBSD and CloudABI. --- bufferevent-internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bufferevent-internal.h b/bufferevent-internal.h index 0b73d920..c84f09c0 100644 --- a/bufferevent-internal.h +++ b/bufferevent-internal.h @@ -44,6 +44,9 @@ extern "C" { #ifdef _WIN32 #include #endif +#ifdef EVENT__HAVE_NETINET_IN_H +#include +#endif #ifdef EVENT__HAVE_NETINET_IN6_H #include #endif From 5602e451ce872d7d60c640590113c5a81c3fc389 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 25 Aug 2015 23:31:07 +0200 Subject: [PATCH 3/3] Assume that ke_udata is an integer type on CloudABI. --- kqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kqueue.c b/kqueue.c index aa2dcb7b..1f41b5a7 100644 --- a/kqueue.c +++ b/kqueue.c @@ -50,7 +50,7 @@ /* Some platforms apparently define the udata field of struct kevent as * intptr_t, whereas others define it as void*. There doesn't seem to be an * easy way to tell them apart via autoconf, so we need to use OS macros. */ -#if defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) +#if defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) && !defined(__CloudABI__) #define PTR_TO_UDATA(x) ((intptr_t)(x)) #define INT_TO_UDATA(x) ((intptr_t)(x)) #else