diff --git a/buffer.c b/buffer.c index 518d6de1..9e721a72 100644 --- a/buffer.c +++ b/buffer.c @@ -26,7 +26,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -34,34 +34,34 @@ #include #endif -#ifdef HAVE_VASPRINTF +#ifdef _EVENT_HAVE_VASPRINTF /* If we have vasprintf, we need to define this before we include stdio.h. */ #define _GNU_SOURCE #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_SYS_UIO_H +#ifdef _EVENT_HAVE_SYS_UIO_H #include #endif -#ifdef HAVE_SYS_IOCTL_H +#ifdef _EVENT_HAVE_SYS_IOCTL_H #include #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef _EVENT_HAVE_SYS_MMAN_H #include #endif -#ifdef HAVE_SYS_SENDFILE_H +#ifdef _EVENT_HAVE_SYS_SENDFILE_H #include #endif @@ -70,17 +70,17 @@ #include #include #include -#ifdef HAVE_STDARG_H +#ifdef _EVENT_HAVE_STDARG_H #include #endif -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif #include "event2/event.h" #include "event2/buffer.h" #include "event2/buffer_compat.h" -#include "config.h" +#include "event-config.h" #include "log-internal.h" #include "mm-internal.h" #include "util-internal.h" @@ -92,10 +92,10 @@ #endif /* send file support */ -#if defined(HAVE_SYS_SENDFILE_H) && defined(HAVE_SENDFILE) && defined(__linux__) +#if defined(_EVENT_HAVE_SYS_SENDFILE_H) && defined(_EVENT_HAVE_SENDFILE) && defined(__linux__) #define USE_SENDFILE 1 #define SENDFILE_IS_LINUX 1 -#elif defined(HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__APPLE__)) +#elif defined(_EVENT_HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__APPLE__)) #define USE_SENDFILE 1 #define SENDFILE_IS_FREEBSD 1 #endif @@ -103,7 +103,7 @@ #ifdef USE_SENDFILE static int use_sendfile = 1; #endif -#ifdef HAVE_MMAP +#ifdef _EVENT_HAVE_MMAP static int use_mmap = 1; #endif @@ -154,7 +154,7 @@ evbuffer_chain_free(struct evbuffer_chain *chain) if (info->cleanupfn) (*info->cleanupfn)(info->extra); } -#ifdef HAVE_MMAP +#ifdef _EVENT_HAVE_MMAP if (chain->flags & EVBUFFER_MMAP) { struct evbuffer_chain_fd *info = EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_fd, @@ -1034,13 +1034,13 @@ _evbuffer_expand_fast(struct evbuffer *buf, size_t datlen) * Reads data from a file descriptor into a buffer. */ -#if defined(HAVE_SYS_UIO_H) +#if defined(_EVENT_HAVE_SYS_UIO_H) #define USE_IOVEC_IMPL #endif #ifdef USE_IOVEC_IMPL -#ifdef HAVE_SYS_UIO_H +#ifdef _EVENT_HAVE_SYS_UIO_H /* number of iovec we use for writev, fragmentation is going to determine * how much we end up writing */ #define NUM_IOVEC 128 @@ -1428,7 +1428,7 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd, { size_t old_len = outbuf->total_len; -#if defined(USE_SENDFILE) || defined(HAVE_MMAP) +#if defined(USE_SENDFILE) || defined(_EVENT_HAVE_MMAP) struct evbuffer_chain *chain; struct evbuffer_chain_fd *info; #endif @@ -1453,7 +1453,7 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd, evbuffer_chain_insert(outbuf, chain); } else #endif -#if defined(HAVE_MMAP) +#if defined(_EVENT_HAVE_MMAP) if (use_mmap) { void *mapped = mmap(NULL, length + offset, PROT_READ, #ifdef MAP_NOCACHE diff --git a/bufferevent-internal.h b/bufferevent-internal.h index b8803eaa..9f9c3af1 100644 --- a/bufferevent-internal.h +++ b/bufferevent-internal.h @@ -31,7 +31,7 @@ extern "C" { #endif -#include "config.h" +#include "event-config.h" #include "evutil.h" struct bufferevent_filter { diff --git a/bufferevent.c b/bufferevent.c index 56f5d110..abdca342 100644 --- a/bufferevent.c +++ b/bufferevent.c @@ -28,10 +28,10 @@ #include #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include @@ -40,7 +40,7 @@ #include #include #include -#ifdef HAVE_STDARG_H +#ifdef _EVENT_HAVE_STDARG_H #include #endif diff --git a/devpoll.c b/devpoll.c index a31745ed..355d6ea0 100644 --- a/devpoll.c +++ b/devpoll.c @@ -25,12 +25,12 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include diff --git a/epoll.c b/epoll.c index b2369c58..a4b11b40 100644 --- a/epoll.c +++ b/epoll.c @@ -25,13 +25,13 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include @@ -44,7 +44,7 @@ #include #include #include -#ifdef HAVE_FCNTL_H +#ifdef _EVENT_HAVE_FCNTL_H #include #endif @@ -77,7 +77,7 @@ const struct eventop epollops = { 0 }; -#ifdef HAVE_SETFD +#ifdef _EVENT_HAVE_SETFD #define FD_CLOSEONEXEC(x) do { \ if (fcntl(x, F_SETFD, 1) == -1) \ event_warn("fcntl(%d, F_SETFD)", x); \ diff --git a/evbuffer-internal.h b/evbuffer-internal.h index 7d4eb2d7..4b809b1a 100644 --- a/evbuffer-internal.h +++ b/evbuffer-internal.h @@ -31,7 +31,7 @@ extern "C" { #endif -#include "config.h" +#include "event-config.h" #include "evutil.h" #include diff --git a/evdns.c b/evdns.c index 0dec001c..42b26c60 100644 --- a/evdns.c +++ b/evdns.c @@ -36,15 +36,15 @@ #include #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef DNS_USE_FTIME_FOR_ID #include #endif -#ifndef DNS_USE_CPU_CLOCK_FOR_ID -#ifndef DNS_USE_GETTIMEOFDAY_FOR_ID +#ifndef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID +#ifndef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID #ifndef DNS_USE_OPENSSL_FOR_ID #ifndef DNS_USE_FTIME_FOR_ID #error Must configure at least one id generation method. @@ -59,18 +59,18 @@ /* for strtok_r */ #define _REENTRANT -#ifdef DNS_USE_CPU_CLOCK_FOR_ID +#ifdef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID #ifdef DNS_USE_OPENSSL_FOR_ID #error Multiple id options selected #endif -#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID +#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID #error Multiple id options selected #endif #include #endif #ifdef DNS_USE_OPENSSL_FOR_ID -#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID +#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID #error Multiple id options selected #endif #include @@ -80,17 +80,17 @@ #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_STDINT_H +#ifdef _EVENT_HAVE_STDINT_H #include #endif #include #include #include #include -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif #include @@ -118,7 +118,7 @@ #include #endif -#ifdef HAVE_NETINET_IN6_H +#ifdef _EVENT_HAVE_NETINET_IN6_H #include #endif @@ -1079,7 +1079,7 @@ static u16 default_transaction_id_fn(void) { u16 trans_id; -#ifdef DNS_USE_CPU_CLOCK_FOR_ID +#ifdef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID struct timespec ts; static int clkid = -1; if (clkid == -1) { @@ -1100,7 +1100,7 @@ default_transaction_id_fn(void) trans_id = tb.millitm & 0xffff; #endif -#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID +#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID struct timeval tv; evutil_gettimeofday(&tv, NULL); trans_id = tv.tv_usec & 0xffff; @@ -2824,7 +2824,7 @@ evdns_resolv_set_defaults(struct evdns_base *base, int flags) { if (flags & DNS_OPTION_NAMESERVERS) evdns_base_nameserver_ip_add(base,"127.0.0.1"); } -#ifndef HAVE_STRTOK_R +#ifndef _EVENT_HAVE_STRTOK_R static char * strtok_r(char *s, const char *delim, char **state) { char *cp, *start; diff --git a/event-internal.h b/event-internal.h index 8ee32f4b..3dc8267e 100644 --- a/event-internal.h +++ b/event-internal.h @@ -31,7 +31,7 @@ extern "C" { #endif -#include "config.h" +#include "event-config.h" #include "minheap-internal.h" #include "evsignal-internal.h" #include "mm-internal.h" @@ -145,7 +145,7 @@ struct event_config { }; /* Internal use only: Functions that might be missing from */ -#ifndef HAVE_TAILQFOREACH +#ifndef _EVENT_HAVE_TAILQFOREACH #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_END(head) NULL #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) diff --git a/event.c b/event.c index 99263f0a..e27305aa 100644 --- a/event.c +++ b/event.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -36,22 +36,22 @@ #endif #include #ifndef WIN32 -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include #endif #endif #include -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif #include #include -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif -#ifdef HAVE_SYS_EVENTFD_H +#ifdef _EVENT_HAVE_SYS_EVENTFD_H #include #endif #include @@ -71,22 +71,22 @@ #include "log-internal.h" #include "evmap-internal.h" -#ifdef HAVE_EVENT_PORTS +#ifdef _EVENT_HAVE_EVENT_PORTS extern const struct eventop evportops; #endif -#ifdef HAVE_SELECT +#ifdef _EVENT_HAVE_SELECT extern const struct eventop selectops; #endif -#ifdef HAVE_POLL +#ifdef _EVENT_HAVE_POLL extern const struct eventop pollops; #endif -#ifdef HAVE_EPOLL +#ifdef _EVENT_HAVE_EPOLL extern const struct eventop epollops; #endif -#ifdef HAVE_WORKING_KQUEUE +#ifdef _EVENT_HAVE_WORKING_KQUEUE extern const struct eventop kqops; #endif -#ifdef HAVE_DEVPOLL +#ifdef _EVENT_HAVE_DEVPOLL extern const struct eventop devpollops; #endif #ifdef WIN32 @@ -95,22 +95,22 @@ extern const struct eventop win32ops; /* In order of preference */ static const struct eventop *eventops[] = { -#ifdef HAVE_EVENT_PORTS +#ifdef _EVENT_HAVE_EVENT_PORTS &evportops, #endif -#ifdef HAVE_WORKING_KQUEUE +#ifdef _EVENT_HAVE_WORKING_KQUEUE &kqops, #endif -#ifdef HAVE_EPOLL +#ifdef _EVENT_HAVE_EPOLL &epollops, #endif -#ifdef HAVE_DEVPOLL +#ifdef _EVENT_HAVE_DEVPOLL &devpollops, #endif -#ifdef HAVE_POLL +#ifdef _EVENT_HAVE_POLL &pollops, #endif -#ifdef HAVE_SELECT +#ifdef _EVENT_HAVE_SELECT &selectops, #endif #ifdef WIN32 @@ -152,7 +152,7 @@ static int evthread_notify_base(struct event_base *base); static void detect_monotonic(void) { -#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) @@ -168,7 +168,7 @@ gettime(struct event_base *base, struct timeval *tp) return (0); } -#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) if (use_monotonic) { struct timespec ts; @@ -1061,7 +1061,7 @@ evthread_notify_base_default(struct event_base *base) return (r < 0) ? -1 : 0; } -#if defined(HAVE_EVENTFD) && defined(HAVE_SYS_EVENTFD_H) +#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H) static int evthread_notify_base_eventfd(struct event_base *base) { @@ -1445,7 +1445,7 @@ event_queue_insert(struct event_base *base, struct event *ev, int queue) const char * event_get_version(void) { - return (VERSION); + return (_EVENT_VERSION); } /* @@ -1535,13 +1535,13 @@ void evthread_set_locking_callback(struct event_base *base, void (*locking_fn)(int mode, void *lock)) { -#ifdef DISABLE_THREAD_SUPPORT +#ifdef _EVENT_DISABLE_THREAD_SUPPORT event_errx(1, "%s: not compiled with thread support", __func__); #endif base->th_lock = locking_fn; } -#if defined(HAVE_EVENTFD) && defined(HAVE_SYS_EVENTFD_H) +#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H) static void evthread_notify_drain_eventfd(int fd, short what, void *arg) { @@ -1568,7 +1568,7 @@ void evthread_set_id_callback(struct event_base *base, unsigned long (*id_fn)(void)) { -#ifdef DISABLE_THREAD_SUPPORT +#ifdef _EVENT_DISABLE_THREAD_SUPPORT event_errx(1, "%s: not compiled with thread support", __func__); #endif #ifdef WIN32 @@ -1598,7 +1598,7 @@ evthread_make_base_notifiable(struct event_base *base) if (base->th_notify_fd[0] >= 0) return 0; -#if defined(HAVE_EVENTFD) && defined(HAVE_SYS_EVENTFD_H) +#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H) base->th_notify_fd[0] = eventfd(0, 0); if (base->th_notify_fd[0] >= 0) { notify = evthread_notify_base_eventfd; @@ -1648,7 +1648,7 @@ void evthread_set_lock_create_callbacks(struct event_base *base, void *(*alloc_fn)(void), void (*free_fn)(void *)) { -#ifdef DISABLE_THREAD_SUPPORT +#ifdef _EVENT_DISABLE_THREAD_SUPPORT event_errx(1, "%s: not compiled with thread support", __func__); #endif base->th_alloc = alloc_fn; diff --git a/event_tagging.c b/event_tagging.c index a74c3544..5d0efaf6 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -26,13 +26,13 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif -#ifdef HAVE_SYS_TYPES_H +#ifdef _EVENT_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_PARAM_H +#ifdef _EVENT_HAVE_SYS_PARAM_H #include #endif @@ -46,7 +46,7 @@ #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif @@ -57,7 +57,7 @@ #ifndef WIN32 #include #endif -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif diff --git a/evmap.c b/evmap.c index ee04639a..22e26a44 100644 --- a/evmap.c +++ b/evmap.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -34,7 +34,7 @@ #undef WIN32_LEAN_AND_MEAN #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include diff --git a/evport.c b/evport.c index b349973a..79ab2380 100644 --- a/evport.c +++ b/evport.c @@ -51,7 +51,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/evrpc.c b/evrpc.c index be4cea65..340808fd 100644 --- a/evrpc.c +++ b/evrpc.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -39,7 +39,7 @@ #ifndef WIN32 #include #endif -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include diff --git a/evsignal-internal.h b/evsignal-internal.h index 5e380d43..944558c5 100644 --- a/evsignal-internal.h +++ b/evsignal-internal.h @@ -39,7 +39,7 @@ struct evsig_info { int ev_signal_added; volatile sig_atomic_t evsig_caught; sig_atomic_t evsigcaught[NSIG]; -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION struct sigaction **sh_old; #else ev_sighandler_t **sh_old; diff --git a/evthread-internal.h b/evthread-internal.h index abc0c98d..64f9928d 100644 --- a/evthread-internal.h +++ b/evthread-internal.h @@ -31,10 +31,10 @@ extern "C" { #endif -#include "config.h" +#include "event-config.h" struct event_base; -#ifndef DISABLE_THREAD_SUPPORT +#ifndef _EVENT_DISABLE_THREAD_SUPPORT #define EVTHREAD_USE_LOCKS(base) \ (base != NULL && (base)->th_lock != NULL) @@ -56,7 +56,7 @@ struct event_base; (*(base)->th_lock)(EVTHREAD_UNLOCK | mode, \ (base)->lock); \ } while (0) -#else /* DISABLE_THREAD_SUPPORT */ +#else /* _EVENT_DISABLE_THREAD_SUPPORT */ #define EVTHREAD_USE_LOCKS(base) #define EVTHREAD_IN_THREAD(base) 1 #define EVTHREAD_GET_ID(base) diff --git a/evthread_pthread.c b/evthread_pthread.c index 72f11a72..1fe2c67b 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -1,5 +1,5 @@ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/evthread_win32.c b/evthread_win32.c index cfe76fc1..0c873f6f 100644 --- a/evthread_win32.c +++ b/evthread_win32.c @@ -1,5 +1,5 @@ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 diff --git a/evutil.c b/evutil.c index 542ba31e..ba809808 100644 --- a/evutil.c +++ b/evutil.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -37,29 +37,29 @@ #endif #include -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif -#ifdef HAVE_FCNTL_H +#ifdef _EVENT_HAVE_FCNTL_H #include #endif -#ifdef HAVE_STDLIB_H +#ifdef _EVENT_HAVE_STDLIB_H #include #endif #include #include #include #include -#ifdef HAVE_ARPA_INET_H +#ifdef _EVENT_HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_NETINET_IN_H +#ifdef _EVENT_HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_NETINET_IN6_H +#ifdef _EVENT_HAVE_NETINET_IN6_H #include #endif @@ -192,9 +192,9 @@ evutil_make_socket_nonblocking(evutil_socket_t fd) ev_int64_t evutil_strtoll(const char *s, char **endptr, int base) { -#ifdef HAVE_STRTOLL +#ifdef _EVENT_HAVE_STRTOLL return (ev_int64_t)strtoll(s, endptr, base); -#elif SIZEOF_LONG == 8 +#elif _EVENT_SIZEOF_LONG == 8 return (ev_int64_t)strtol(s, endptr, base); #elif defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300 /* XXXX on old versions of MS APIs, we only support base @@ -639,7 +639,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int o if (is_ipv6) { struct sockaddr_in6 sin6; memset(&sin6, 0, sizeof(sin6)); -#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN +#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6.sin6_len = sizeof(sin6); #endif sin6.sin6_family = AF_INET6; @@ -654,7 +654,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int o } else { struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); -#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN +#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sin.sin_len = sizeof(sin); #endif sin.sin_family = AF_INET; diff --git a/http.c b/http.c index 03fa95b6..c8b27eae 100644 --- a/http.c +++ b/http.c @@ -26,18 +26,18 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #define _REENTRANT -#ifdef HAVE_SYS_PARAM_H +#ifdef _EVENT_HAVE_SYS_PARAM_H #include #endif -#ifdef HAVE_SYS_TYPES_H +#ifdef _EVENT_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_IOCCOM_H @@ -73,10 +73,10 @@ #endif #include #include -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif -#ifdef HAVE_FCNTL_H +#ifdef _EVENT_HAVE_FCNTL_H #include #endif @@ -101,7 +101,7 @@ #define strncasecmp _strnicmp #endif -#ifndef HAVE_GETNAMEINFO +#ifndef _EVENT_HAVE_GETNAMEINFO #define NI_MAXSERV 32 #define NI_MAXHOST 1025 @@ -147,7 +147,7 @@ fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, #endif -#ifndef HAVE_GETADDRINFO +#ifndef _EVENT_HAVE_GETADDRINFO struct addrinfo { int ai_family; int ai_socktype; @@ -220,7 +220,7 @@ static void evhttp_error_cb(struct bufferevent *bufev, short what, void *arg); static int evhttp_decode_uri_internal(const char *uri, size_t length, char *ret); -#ifndef HAVE_STRSEP +#ifndef _EVENT_HAVE_STRSEP /* strsep replacement for platforms that lack it. Only works if * del is one character long. */ static char * @@ -2803,7 +2803,7 @@ evhttp_get_request(struct evhttp *http, evutil_socket_t fd, static struct addrinfo * addr_from_name(char *address) { -#ifdef HAVE_GETADDRINFO +#ifdef _EVENT_HAVE_GETADDRINFO struct addrinfo ai, *aitop; int ai_result; @@ -2834,7 +2834,7 @@ name_from_addr(struct sockaddr *sa, socklen_t salen, char strport[NI_MAXSERV]; int ni_result; -#ifdef HAVE_GETNAMEINFO +#ifdef _EVENT_HAVE_GETNAMEINFO ni_result = getnameinfo(sa, salen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV); @@ -2911,7 +2911,7 @@ make_addrinfo(const char *address, ev_uint16_t port) { struct addrinfo *aitop = NULL; -#ifdef HAVE_GETADDRINFO +#ifdef _EVENT_HAVE_GETADDRINFO struct addrinfo ai; char strport[NI_MAXSERV]; int ai_result; @@ -2961,7 +2961,7 @@ bind_socket(const char *address, ev_uint16_t port, int reuse) fd = bind_socket_ai(aitop, reuse); -#ifdef HAVE_GETADDRINFO +#ifdef _EVENT_HAVE_GETADDRINFO freeaddrinfo(aitop); #else fake_freeaddrinfo(aitop); @@ -2992,7 +2992,7 @@ socket_connect(evutil_socket_t fd, const char *address, unsigned short port) res = 0; out: -#ifdef HAVE_GETADDRINFO +#ifdef _EVENT_HAVE_GETADDRINFO freeaddrinfo(ai); #else fake_freeaddrinfo(ai); diff --git a/kqueue.c b/kqueue.c index 8224a091..be55ced6 100644 --- a/kqueue.c +++ b/kqueue.c @@ -27,11 +27,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include @@ -45,14 +45,14 @@ #include #include #include -#ifdef HAVE_INTTYPES_H +#ifdef _EVENT_HAVE_INTTYPES_H #include #endif /* 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(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__) #define PTR_TO_UDATA(x) ((intptr_t)(x)) #else #define PTR_TO_UDATA(x) (x) diff --git a/log.c b/log.c index 793ea5c2..d157a694 100644 --- a/log.c +++ b/log.c @@ -38,7 +38,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -47,7 +47,7 @@ #undef WIN32_LEAN_AND_MEAN #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include diff --git a/poll.c b/poll.c index f5dd9b56..c18afd24 100644 --- a/poll.c +++ b/poll.c @@ -27,11 +27,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include diff --git a/sample/event-test.c b/sample/event-test.c index b4276aa9..f86cb62e 100644 --- a/sample/event-test.c +++ b/sample/event-test.c @@ -4,7 +4,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/sample/signal-test.c b/sample/signal-test.c index cb464834..cd1302f4 100644 --- a/sample/signal-test.c +++ b/sample/signal-test.c @@ -7,7 +7,7 @@ #include #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/sample/time-test.c b/sample/time-test.c index faf0999d..a9504ba1 100644 --- a/sample/time-test.c +++ b/sample/time-test.c @@ -6,7 +6,7 @@ #include #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include @@ -15,7 +15,7 @@ #include #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include diff --git a/select.c b/select.c index 76974798..16313248 100644 --- a/select.c +++ b/select.c @@ -27,16 +27,16 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #else #include #endif -#ifdef HAVE_SYS_SELECT_H +#ifdef _EVENT_HAVE_SYS_SELECT_H #include #endif #include diff --git a/signal.c b/signal.c index 30c5e026..86b12c5b 100644 --- a/signal.c +++ b/signal.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifdef WIN32 @@ -37,22 +37,22 @@ #undef WIN32_LEAN_AND_MEAN #endif #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif #include #include #include #include -#ifdef HAVE_UNISTD_H +#ifdef _EVENT_HAVE_UNISTD_H #include #endif #include -#ifdef HAVE_FCNTL_H +#ifdef _EVENT_HAVE_FCNTL_H #include #endif #include @@ -99,7 +99,7 @@ evsig_cb(evutil_socket_t fd, short what, void *arg) event_sock_err(1, fd, "%s: read", __func__); } -#ifdef HAVE_SETFD +#ifdef _EVENT_HAVE_SETFD #define FD_CLOSEONEXEC(x) do { \ if (fcntl(x, F_SETFD, 1) == -1) \ event_warn("fcntl(%d, F_SETFD)", x); \ @@ -144,7 +144,7 @@ int _evsig_set_handler(struct event_base *base, int evsignal, void (*handler)(int)) { -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION struct sigaction sa; #else ev_sighandler_t sh; @@ -181,7 +181,7 @@ _evsig_set_handler(struct event_base *base, } /* save previous handler and setup new handler */ -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION memset(&sa, 0, sizeof(sa)); sa.sa_handler = handler; sa.sa_flags |= SA_RESTART; @@ -233,7 +233,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal) { int ret = 0; struct evsig_info *sig = &base->sig; -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION struct sigaction *sh; #else ev_sighandler_t *sh; @@ -242,7 +242,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal) /* restore previous handler */ sh = sig->sh_old[evsignal]; sig->sh_old[evsignal] = NULL; -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION if (sigaction(evsignal, sh, NULL) == -1) { event_warn("sigaction"); ret = -1; @@ -287,7 +287,7 @@ evsig_handler(int sig) evsig_base->sig.evsigcaught[sig]++; evsig_base->sig.evsig_caught = 1; -#ifndef HAVE_SIGACTION +#ifndef _EVENT_HAVE_SIGACTION signal(sig, evsig_handler); #endif diff --git a/strlcpy-internal.h b/strlcpy-internal.h index 22b5f61d..12f09a38 100644 --- a/strlcpy-internal.h +++ b/strlcpy-internal.h @@ -6,10 +6,10 @@ extern "C" { #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif /* HAVE_CONFIG_H */ -#ifndef HAVE_STRLCPY +#ifndef _EVENT_HAVE_STRLCPY #include size_t _event_strlcpy(char *dst, const char *src, size_t siz); #define strlcpy _event_strlcpy diff --git a/strlcpy.c b/strlcpy.c index 5d194527..7fd0884a 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -34,10 +34,10 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp #include #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif /* HAVE_CONFIG_H */ -#ifndef HAVE_STRLCPY +#ifndef _EVENT_HAVE_STRLCPY #include "strlcpy-internal.h" /* diff --git a/test/bench.c b/test/bench.c index 7719e05b..6f1789f4 100644 --- a/test/bench.c +++ b/test/bench.c @@ -34,7 +34,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/test/bench_cascade.c b/test/bench_cascade.c index 69508e1e..1a243a05 100644 --- a/test/bench_cascade.c +++ b/test/bench_cascade.c @@ -27,7 +27,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/test/bench_http.c b/test/bench_http.c index b84af272..c9577abe 100644 --- a/test/bench_http.c +++ b/test/bench_http.c @@ -27,7 +27,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/test/regress.c b/test/regress.c index 6fbc32ae..13782da6 100644 --- a/test/regress.c +++ b/test/regress.c @@ -31,12 +31,12 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include @@ -811,13 +811,13 @@ test_signal_restore(void) { struct event ev; struct event_base *base = event_init(); -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION struct sigaction sa; #endif test_ok = 0; printf("Signal handler restore: "); -#ifdef HAVE_SIGACTION +#ifdef _EVENT_HAVE_SIGACTION sa.sa_handler = signal_cb_sa; sa.sa_flags = 0x0; sigemptyset(&sa.sa_mask); @@ -2375,11 +2375,11 @@ main (int argc, char **argv) test_event_base_new(); -#if defined(HAVE_PTHREADS) && !defined(DISABLE_THREAD_SUPPORT) +#if defined(_EVENT_HAVE_PTHREADS) && !defined(_EVENT_DISABLE_THREAD_SUPPORT) regress_pthread(); #endif -#if defined(HAVE_LIBZ) +#if defined(_EVENT_HAVE_LIBZ) regress_zlib(); #endif diff --git a/test/regress_dns.c b/test/regress_dns.c index 96a47041..08acffc7 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -31,12 +31,12 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include @@ -47,7 +47,7 @@ #include #include #endif -#ifdef HAVE_NETINET_IN6_H +#ifdef _EVENT_HAVE_NETINET_IN6_H #include #endif #ifdef HAVE_NETDB_H @@ -90,7 +90,7 @@ dns_gethostbyname_cb(int result, char type, int count, int ttl, switch (type) { case DNS_IPv6_AAAA: { -#if defined(HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN) +#if defined(_EVENT_HAVE_STRUCT_IN6_ADDR) && defined(_EVENT_HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN) struct in6_addr *in6_addrs = addresses; char buf[INET6_ADDRSTRLEN+1]; int i; @@ -297,7 +297,7 @@ dns_server_gethostbyname_cb(int result, char type, int count, int ttl, break; } case DNS_IPv6_AAAA: { -#if defined (HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN) +#if defined (_EVENT_HAVE_STRUCT_IN6_ADDR) && defined(_EVENT_HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN) struct in6_addr *in6_addrs = addresses; char buf[INET6_ADDRSTRLEN+1]; if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16) diff --git a/test/regress_http.c b/test/regress_http.c index 889c852e..2ad5befc 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -31,12 +31,12 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include diff --git a/test/regress_pthread.c b/test/regress_pthread.c index ea97fc7f..72323ca8 100644 --- a/test/regress_pthread.c +++ b/test/regress_pthread.c @@ -26,7 +26,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/test/regress_rpc.c b/test/regress_rpc.c index ac4bdbc7..649d275d 100644 --- a/test/regress_rpc.c +++ b/test/regress_rpc.c @@ -31,12 +31,12 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include -#ifdef HAVE_SYS_TIME_H +#ifdef _EVENT_HAVE_SYS_TIME_H #include #endif #include diff --git a/test/regress_util.c b/test/regress_util.c index ab32ecb4..7bdec59d 100644 --- a/test/regress_util.c +++ b/test/regress_util.c @@ -31,7 +31,7 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #ifndef WIN32 #include @@ -40,7 +40,7 @@ #include #include #endif -#ifdef HAVE_NETINET_IN6_H +#ifdef _EVENT_HAVE_NETINET_IN6_H #include #endif #include @@ -261,7 +261,7 @@ regress_sockaddr_port_parse(void) if (ent->sa_family == AF_INET) { struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); -#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN +#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sin.sin_len = sizeof(sin); #endif sin.sin_family = AF_INET; @@ -277,7 +277,7 @@ regress_sockaddr_port_parse(void) } else { struct sockaddr_in6 sin6; memset(&sin6, 0, sizeof(sin6)); -#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN +#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6.sin6_len = sizeof(sin6); #endif sin6.sin6_family = AF_INET6; diff --git a/test/regress_zlib.c b/test/regress_zlib.c index 9de66967..089b9928 100644 --- a/test/regress_zlib.c +++ b/test/regress_zlib.c @@ -31,7 +31,7 @@ #endif #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include diff --git a/test/test-eof.c b/test/test-eof.c index 9577ed5d..5706aed6 100644 --- a/test/test-eof.c +++ b/test/test-eof.c @@ -3,7 +3,7 @@ * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif @@ -13,7 +13,7 @@ #include #include #include -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif #include diff --git a/test/test-init.c b/test/test-init.c index c368715f..6e2ec141 100644 --- a/test/test-init.c +++ b/test/test-init.c @@ -3,14 +3,14 @@ * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif #include #include #include -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif #include diff --git a/test/test-time.c b/test/test-time.c index b44a6370..14bed7c4 100644 --- a/test/test-time.c +++ b/test/test-time.c @@ -3,7 +3,7 @@ * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif diff --git a/test/test-weof.c b/test/test-weof.c index 91982656..73af086b 100644 --- a/test/test-weof.c +++ b/test/test-weof.c @@ -3,7 +3,7 @@ * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include "event-config.h" #endif @@ -13,7 +13,7 @@ #include #include #include -#ifdef HAVE_SYS_SOCKET_H +#ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif #include