From 68120d9b000a3ad8e09388a66acf6d902136ae8b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 29 Feb 2012 15:07:31 -0500 Subject: [PATCH] Convert event-config.h macros to avoid reserved identifiers C reserves all identifiers beginning with an underscore for system use. But we had been mangling our autoconf identifiers with the prefix "_EVENT_" to avoid conflict with other programs. Instead, we will now use the prefix "EVENT__". With any luck, the double-underscore will still hint "here be dragons" to anybody tempted to think that event-config.h is a stable api. This is an automatically generated patch. The script that produced it was made by running this script over config.h.in: ===== #!/usr/bin/perl -w # Run this on config.h.in use strict; my %macros = (); while (<>) { if (/^# *undef +([A-Za-z0-9_]+)/) { $macros{$1} = 1; } } print "#!/usr/bin/perl -w -i -p\n\n"; for my $k (sort keys %macros) { print "s/(? header file. */ -/* #undef _EVENT_HAVE_ARPA_INET_H */ +/* #undef EVENT__HAVE_ARPA_INET_H */ /* Define to 1 if you have the `clock_gettime' function. */ -/* #undef _EVENT_HAVE_CLOCK_GETTIME */ +/* #undef EVENT__HAVE_CLOCK_GETTIME */ /* Define if /dev/poll is available */ -/* #undef _EVENT_HAVE_DEVPOLL */ +/* #undef EVENT__HAVE_DEVPOLL */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_DLFCN_H */ +/* #undef EVENT__HAVE_DLFCN_H */ /* Define if your system supports the epoll system calls */ -/* #undef _EVENT_HAVE_EPOLL */ +/* #undef EVENT__HAVE_EPOLL */ /* Define to 1 if you have the `epoll_ctl' function. */ -/* #undef _EVENT_HAVE_EPOLL_CTL */ +/* #undef EVENT__HAVE_EPOLL_CTL */ /* Define to 1 if you have the `eventfd' function. */ -/* #undef _EVENT_HAVE_EVENTFD */ +/* #undef EVENT__HAVE_EVENTFD */ /* Define if your system supports event ports */ -/* #undef _EVENT_HAVE_EVENT_PORTS */ +/* #undef EVENT__HAVE_EVENT_PORTS */ /* Define to 1 if you have the `fcntl' function. */ -/* #undef _EVENT_HAVE_FCNTL */ +/* #undef EVENT__HAVE_FCNTL */ /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_FCNTL_H 1 +#define EVENT__HAVE_FCNTL_H 1 /* Define to 1 if you have the `getaddrinfo' function. */ -#define _EVENT_HAVE_GETADDRINFO 1 +#define EVENT__HAVE_GETADDRINFO 1 /* Define to 1 if you have the `getnameinfo' function. */ -#define _EVENT_HAVE_GETNAMEINFO 1 +#define EVENT__HAVE_GETNAMEINFO 1 /* Define to 1 if you have the `getprotobynumber' function. */ -#define _EVENT_HAVE_GETPROTOBYNUMBER 1 +#define EVENT__HAVE_GETPROTOBYNUMBER 1 /* Define to 1 if you have the `getservbyname' function. */ -#define _EVENT_HAVE_GETSERVBYNAME 1 +#define EVENT__HAVE_GETSERVBYNAME 1 /* Define to 1 if you have the `gettimeofday' function. */ -/* #define _EVENT_HAVE_GETTIMEOFDAY 1 */ +/* #define EVENT__HAVE_GETTIMEOFDAY 1 */ /* Define to 1 if you have the `inet_aton' function. */ -/* #undef _EVENT_HAVE_INET_ATON */ +/* #undef EVENT__HAVE_INET_ATON */ /* Define to 1 if you have the `inet_ntop' function. */ -/* #undef _EVENT_HAVE_INET_NTOP */ +/* #undef EVENT__HAVE_INET_NTOP */ /* Define to 1 if you have the `inet_pton' function. */ -/* #undef _EVENT_HAVE_INET_PTON */ +/* #undef EVENT__HAVE_INET_PTON */ /* Define to 1 if you have the header file. */ -/* #define _EVENT_HAVE_INTTYPES_H 1 */ +/* #define EVENT__HAVE_INTTYPES_H 1 */ /* Define to 1 if you have the `kqueue' function. */ -/* #undef _EVENT_HAVE_KQUEUE */ +/* #undef EVENT__HAVE_KQUEUE */ /* Define if the system has zlib */ -/* #undef _EVENT_HAVE_LIBZ */ +/* #undef EVENT__HAVE_LIBZ */ /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_MEMORY_H 1 +#define EVENT__HAVE_MEMORY_H 1 /* Define to 1 if you have the `mmap' function. */ -/* #undef _EVENT_HAVE_MMAP */ +/* #undef EVENT__HAVE_MMAP */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_NETINET_IN6_H */ +/* #undef EVENT__HAVE_NETINET_IN6_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_NETINET_IN_H */ +/* #undef EVENT__HAVE_NETINET_IN_H */ /* Define to 1 if you have the `pipe' function. */ -/* #undef _EVENT_HAVE_PIPE */ +/* #undef EVENT__HAVE_PIPE */ /* Define to 1 if you have the `poll' function. */ -/* #undef _EVENT_HAVE_POLL */ +/* #undef EVENT__HAVE_POLL */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_POLL_H */ +/* #undef EVENT__HAVE_POLL_H */ /* Define to 1 if you have the `port_create' function. */ -/* #undef _EVENT_HAVE_PORT_CREATE */ +/* #undef EVENT__HAVE_PORT_CREATE */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_PORT_H */ +/* #undef EVENT__HAVE_PORT_H */ /* Define if you have POSIX threads libraries and header files. */ -/* #undef _EVENT_HAVE_PTHREAD */ +/* #undef EVENT__HAVE_PTHREAD */ /* Define if we have pthreads on this system */ -/* #undef _EVENT_HAVE_PTHREADS */ +/* #undef EVENT__HAVE_PTHREADS */ /* Define to 1 if the system has the type `sa_family_t'. */ -/* #undef _EVENT_HAVE_SA_FAMILY_T */ +/* #undef EVENT__HAVE_SA_FAMILY_T */ /* Define to 1 if you have the `select' function. */ -/* #undef _EVENT_HAVE_SELECT */ +/* #undef EVENT__HAVE_SELECT */ /* Define to 1 if you have the `sendfile' function. */ -/* #undef _EVENT_HAVE_SENDFILE */ +/* #undef EVENT__HAVE_SENDFILE */ /* Define if F_SETFD is defined in */ -/* #undef _EVENT_HAVE_SETFD */ +/* #undef EVENT__HAVE_SETFD */ /* Define to 1 if you have the `sigaction' function. */ -/* #undef _EVENT_HAVE_SIGACTION */ +/* #undef EVENT__HAVE_SIGACTION */ /* Define to 1 if you have the `signal' function. */ -#define _EVENT_HAVE_SIGNAL 1 +#define EVENT__HAVE_SIGNAL 1 /* Define to 1 if you have the `splice' function. */ -/* #undef _EVENT_HAVE_SPLICE */ +/* #undef EVENT__HAVE_SPLICE */ /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_STDARG_H 1 +#define EVENT__HAVE_STDARG_H 1 /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_STDDEF_H 1 +#define EVENT__HAVE_STDDEF_H 1 /* Define to 1 if you have the header file. */ -/* #define _EVENT_HAVE_STDINT_H 1 */ +/* #define EVENT__HAVE_STDINT_H 1 */ /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_STDLIB_H 1 +#define EVENT__HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_STRINGS_H 1 +#define EVENT__HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_STRING_H 1 +#define EVENT__HAVE_STRING_H 1 /* Define to 1 if you have the `strlcpy' function. */ -/* #undef _EVENT_HAVE_STRLCPY */ +/* #undef EVENT__HAVE_STRLCPY */ /* Define to 1 if you have the `strsep' function. */ -/* #undef _EVENT_HAVE_STRSEP */ +/* #undef EVENT__HAVE_STRSEP */ /* Define to 1 if you have the `strtok_r' function. */ -/* #undef _EVENT_HAVE_STRTOK_R */ +/* #undef EVENT__HAVE_STRTOK_R */ /* Define to 1 if you have the `strtoll' function. */ -/* #define _EVENT_HAVE_STRTOLL 1 */ +/* #define EVENT__HAVE_STRTOLL 1 */ -#define _EVENT_HAVE_STRUCT_ADDRINFO 1 +#define EVENT__HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if the system has the type `struct in6_addr'. */ -#define _EVENT_HAVE_STRUCT_IN6_ADDR 1 +#define EVENT__HAVE_STRUCT_IN6_ADDR 1 /* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */ -#define _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1 +#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1 /* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */ -#define _EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1 +#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1 /* Define to 1 if the system has the type `struct sockaddr_in6'. */ -#define _EVENT_HAVE_STRUCT_SOCKADDR_IN6 1 +#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1 /* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */ -/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */ +/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */ /* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ -/* #undef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ +/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ /* Define to 1 if the system has the type `struct sockaddr_storage'. */ -#define _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE 1 +#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */ +/* #undef EVENT__HAVE_SYS_DEVPOLL_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_EPOLL_H */ +/* #undef EVENT__HAVE_SYS_EPOLL_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_EVENTFD_H */ +/* #undef EVENT__HAVE_SYS_EVENTFD_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_EVENT_H */ +/* #undef EVENT__HAVE_SYS_EVENT_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_IOCTL_H */ +/* #undef EVENT__HAVE_SYS_IOCTL_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_MMAN_H */ +/* #undef EVENT__HAVE_SYS_MMAN_H */ /* Define to 1 if you have the header file. */ -/* #define _EVENT_HAVE_SYS_PARAM_H 1 */ +/* #define EVENT__HAVE_SYS_PARAM_H 1 */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_QUEUE_H */ +/* #undef EVENT__HAVE_SYS_QUEUE_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_SELECT_H */ +/* #undef EVENT__HAVE_SYS_SELECT_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_SENDFILE_H */ +/* #undef EVENT__HAVE_SYS_SENDFILE_H */ /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_SOCKET_H */ +/* #undef EVENT__HAVE_SYS_SOCKET_H */ /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_SYS_STAT_H 1 +#define EVENT__HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ -/* #define _EVENT_HAVE_SYS_TIME_H 1 */ +/* #define EVENT__HAVE_SYS_TIME_H 1 */ /* Define to 1 if you have the header file. */ -#define _EVENT_HAVE_SYS_TYPES_H 1 +#define EVENT__HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ -/* #undef _EVENT_HAVE_SYS_UIO_H */ +/* #undef EVENT__HAVE_SYS_UIO_H */ /* Define if TAILQ_FOREACH is defined in */ -/* #undef _EVENT_HAVE_TAILQFOREACH */ +/* #undef EVENT__HAVE_TAILQFOREACH */ /* Define if timeradd is defined in */ -/* #undef _EVENT_HAVE_TIMERADD */ +/* #undef EVENT__HAVE_TIMERADD */ /* Define if timerclear is defined in */ -#define _EVENT_HAVE_TIMERCLEAR 1 +#define EVENT__HAVE_TIMERCLEAR 1 /* Define if timercmp is defined in */ -#define _EVENT_HAVE_TIMERCMP 1 +#define EVENT__HAVE_TIMERCMP 1 /* Define if timerisset is defined in */ -#define _EVENT_HAVE_TIMERISSET 1 +#define EVENT__HAVE_TIMERISSET 1 /* Define to 1 if the system has the type `uint16_t'. */ -/* #define _EVENT_HAVE_UINT16_T 1 */ +/* #define EVENT__HAVE_UINT16_T 1 */ /* Define to 1 if the system has the type `uint32_t'. */ -/* #define _EVENT_HAVE_UINT32_T 1 */ +/* #define EVENT__HAVE_UINT32_T 1 */ /* Define to 1 if the system has the type `uint64_t'. */ -/* #define _EVENT_HAVE_UINT64_T 1 */ +/* #define EVENT__HAVE_UINT64_T 1 */ /* Define to 1 if the system has the type `uint8_t'. */ -/* #define _EVENT_HAVE_UINT8_T 1 */ +/* #define EVENT__HAVE_UINT8_T 1 */ /* Define to 1 if you have the header file. */ -/* #define _EVENT_HAVE_UNISTD_H 1 */ +/* #define EVENT__HAVE_UNISTD_H 1 */ /* Define to 1 if you have the `vasprintf' function. */ -/* #undef _EVENT_HAVE_VASPRINTF */ +/* #undef EVENT__HAVE_VASPRINTF */ /* Define if kqueue works correctly with pipes */ -/* #undef _EVENT_HAVE_WORKING_KQUEUE */ +/* #undef EVENT__HAVE_WORKING_KQUEUE */ /* Numeric representation of the version */ -#define _EVENT_NUMERIC_VERSION 0x02010001 +#define EVENT__NUMERIC_VERSION 0x02010001 /* Name of package */ -#define _EVENT_PACKAGE "libevent" +#define EVENT__PACKAGE "libevent" /* Define to the address where bug reports for this package should be sent. */ -#define _EVENT_PACKAGE_BUGREPORT "" +#define EVENT__PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define _EVENT_PACKAGE_NAME "" +#define EVENT__PACKAGE_NAME "" /* Define to the full name and version of this package. */ -#define _EVENT_PACKAGE_STRING "" +#define EVENT__PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ -#define _EVENT_PACKAGE_TARNAME "" +#define EVENT__PACKAGE_TARNAME "" /* Define to the version of this package. */ -#define _EVENT_PACKAGE_VERSION "" +#define EVENT__PACKAGE_VERSION "" /* Define to necessary symbol if this constant uses a non-standard name on your system. */ -/* #undef _EVENT_PTHREAD_CREATE_JOINABLE */ +/* #undef EVENT__PTHREAD_CREATE_JOINABLE */ /* The size of a `int', as computed by sizeof. */ -#define _EVENT_SIZEOF_INT 4 +#define EVENT__SIZEOF_INT 4 /* The size of a `long', as computed by sizeof. */ -#define _EVENT_SIZEOF_LONG 4 +#define EVENT__SIZEOF_LONG 4 /* The size of a `long long', as computed by sizeof. */ -#define _EVENT_SIZEOF_LONG_LONG 8 +#define EVENT__SIZEOF_LONG_LONG 8 /* The size of a `short', as computed by sizeof. */ -#define _EVENT_SIZEOF_SHORT 2 +#define EVENT__SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #ifdef _WIN64 -#define _EVENT_SIZEOF_SIZE_T 8 +#define EVENT__SIZEOF_SIZE_T 8 #else -#define _EVENT_SIZEOF_SIZE_T 4 +#define EVENT__SIZEOF_SIZE_T 4 #endif /* The size of `void *', as computed by sizeof. */ #ifdef _WIN64 -#define _EVENT_SIZEOF_VOID_P 8 +#define EVENT__SIZEOF_VOID_P 8 #else -#define _EVENT_SIZEOF_VOID_P 4 +#define EVENT__SIZEOF_VOID_P 4 #endif /* Define to 1 if you have the ANSI C header files. */ -#define _EVENT_STDC_HEADERS 1 +#define EVENT__STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ -#define _EVENT_TIME_WITH_SYS_TIME 1 +#define EVENT__TIME_WITH_SYS_TIME 1 /* Version number of package */ <<<<<<< HEAD -#define _EVENT_VERSION "2.1.0-alpha-dev" +#define EVENT__VERSION "2.1.0-alpha-dev" ||||||| merged common ancestors -#define _EVENT_VERSION "2.0.16-stable-dev" +#define EVENT__VERSION "2.0.16-stable-dev" ======= -#define _EVENT_VERSION "2.0.17-stable" +#define EVENT__VERSION "2.0.17-stable" >>>>>>> origin/patches-2.0 /* Define to appropriate substitue if compiler doesnt have __func__ */ -#define _EVENT___func__ __FUNCTION__ +#define EVENT____func__ __FUNCTION__ /* Define to empty if `const' does not conform to ANSI C. */ -/* #undef _EVENT_const */ +/* #undef EVENT__const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef _EVENT___cplusplus -#define _EVENT_inline __inline +#define EVENT__inline __inline #endif /* Define to `int' if does not define. */ -/* #undef _EVENT_pid_t */ +/* #undef EVENT__pid_t */ /* Define to `unsigned' if does not define. */ -/* #undef _EVENT_size_t */ +/* #undef EVENT__size_t */ /* Define to unsigned int if you dont have it */ -#define _EVENT_socklen_t unsigned int +#define EVENT__socklen_t unsigned int /* Define to `int' if does not define. */ -#define _EVENT_ssize_t SSIZE_T +#define EVENT__ssize_t SSIZE_T #endif diff --git a/arc4random.c b/arc4random.c index fe0234c156..52eeca8317 100644 --- a/arc4random.c +++ b/arc4random.c @@ -59,7 +59,7 @@ #include #include #include -#ifdef _EVENT_HAVE_SYS_SYSCTL_H +#ifdef EVENT__HAVE_SYS_SYSCTL_H #include #endif #endif @@ -168,8 +168,8 @@ arc4_seed_win32(void) } #endif -#if defined(_EVENT_HAVE_SYS_SYSCTL_H) && defined(_EVENT_HAVE_SYSCTL) -#if _EVENT_HAVE_DECL_CTL_KERN && _EVENT_HAVE_DECL_KERN_RANDOM && _EVENT_HAVE_DECL_RANDOM_UUID +#if defined(EVENT__HAVE_SYS_SYSCTL_H) && defined(EVENT__HAVE_SYSCTL) +#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_RANDOM && EVENT__HAVE_DECL_RANDOM_UUID #define TRY_SEED_SYSCTL_LINUX static int arc4_seed_sysctl_linux(void) @@ -206,7 +206,7 @@ arc4_seed_sysctl_linux(void) } #endif -#if _EVENT_HAVE_DECL_CTL_KERN && _EVENT_HAVE_DECL_KERN_ARND +#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_ARND #define TRY_SEED_SYSCTL_BSD static int arc4_seed_sysctl_bsd(void) @@ -245,7 +245,7 @@ arc4_seed_sysctl_bsd(void) return 0; } #endif -#endif /* defined(_EVENT_HAVE_SYS_SYSCTL_H) */ +#endif /* defined(EVENT__HAVE_SYS_SYSCTL_H) */ #ifdef __linux__ #define TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID diff --git a/buffer.c b/buffer.c index 00035745a1..05b29cbdf2 100644 --- a/buffer.c +++ b/buffer.c @@ -34,7 +34,7 @@ #include #endif -#ifdef _EVENT_HAVE_VASPRINTF +#ifdef EVENT__HAVE_VASPRINTF /* If we have vasprintf, we need to define _GNU_SOURCE before we include * stdio.h. This comes from evconfig-private.h. */ @@ -42,30 +42,30 @@ #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif -#ifdef _EVENT_HAVE_SYS_UIO_H +#ifdef EVENT__HAVE_SYS_UIO_H #include #endif -#ifdef _EVENT_HAVE_SYS_IOCTL_H +#ifdef EVENT__HAVE_SYS_IOCTL_H #include #endif -#ifdef _EVENT_HAVE_SYS_MMAN_H +#ifdef EVENT__HAVE_SYS_MMAN_H #include #endif -#ifdef _EVENT_HAVE_SYS_SENDFILE_H +#ifdef EVENT__HAVE_SYS_SENDFILE_H #include #endif -#ifdef _EVENT_HAVE_SYS_STAT_H +#ifdef EVENT__HAVE_SYS_STAT_H #include #endif @@ -74,10 +74,10 @@ #include #include #include -#ifdef _EVENT_HAVE_STDARG_H +#ifdef EVENT__HAVE_STDARG_H #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include @@ -102,16 +102,16 @@ #endif /* send file support */ -#if defined(_EVENT_HAVE_SYS_SENDFILE_H) && defined(_EVENT_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(_EVENT_HAVE_SENDFILE) && defined(__FreeBSD__) +#elif defined(EVENT__HAVE_SENDFILE) && defined(__FreeBSD__) #define USE_SENDFILE 1 #define SENDFILE_IS_FREEBSD 1 -#elif defined(_EVENT_HAVE_SENDFILE) && defined(__APPLE__) +#elif defined(EVENT__HAVE_SENDFILE) && defined(__APPLE__) #define USE_SENDFILE 1 #define SENDFILE_IS_MACOSX 1 -#elif defined(_EVENT_HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__) +#elif defined(EVENT__HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__) #define USE_SENDFILE 1 #define SENDFILE_IS_SOLARIS 1 #endif @@ -413,7 +413,7 @@ evbuffer_defer_callbacks(struct evbuffer *buffer, struct event_base *base) int evbuffer_enable_locking(struct evbuffer *buf, void *lock) { -#ifdef _EVENT_DISABLE_THREAD_SUPPORT +#ifdef EVENT__DISABLE_THREAD_SUPPORT return -1; #else if (buf->lock) @@ -2118,13 +2118,13 @@ evbuffer_expand(struct evbuffer *buf, size_t datlen) * Reads data from a file descriptor into a buffer. */ -#if defined(_EVENT_HAVE_SYS_UIO_H) || defined(_WIN32) +#if defined(EVENT__HAVE_SYS_UIO_H) || defined(_WIN32) #define USE_IOVEC_IMPL #endif #ifdef USE_IOVEC_IMPL -#ifdef _EVENT_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 */ @@ -2938,7 +2938,7 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) if (seg->contents) return 0; /* already materialized */ -#if defined(_EVENT_HAVE_MMAP) +#if defined(EVENT__HAVE_MMAP) if (!(flags & EVBUF_FS_DISABLE_MMAP)) { off_t offset_rounded = 0, offset_leftover = 0; void *mapped; @@ -3054,7 +3054,7 @@ evbuffer_file_segment_free(struct evbuffer_file_segment *seg) if (seg->is_mapping) { #ifdef _WIN32 CloseHandle(seg->mapping_handle); -#elif defined (_EVENT_HAVE_MMAP) +#elif defined (EVENT__HAVE_MMAP) if (munmap(seg->mapping, seg->length) == -1) event_warn("%s: munmap failed", __func__); #endif diff --git a/bufferevent-internal.h b/bufferevent-internal.h index e442e16881..3b35b0cbe2 100644 --- a/bufferevent-internal.h +++ b/bufferevent-internal.h @@ -384,7 +384,7 @@ int _bufferevent_generic_adj_timeouts(struct bufferevent *bev); * bufferevent_private. */ #define BEV_UPCAST(b) EVUTIL_UPCAST((b), struct bufferevent_private, bev) -#ifdef _EVENT_DISABLE_THREAD_SUPPORT +#ifdef EVENT__DISABLE_THREAD_SUPPORT #define BEV_LOCK(b) _EVUTIL_NIL_STMT #define BEV_UNLOCK(b) _EVUTIL_NIL_STMT #else diff --git a/bufferevent.c b/bufferevent.c index 3960bcaf87..43543b6f32 100644 --- a/bufferevent.c +++ b/bufferevent.c @@ -30,7 +30,7 @@ #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -38,7 +38,7 @@ #include #include #include -#ifdef _EVENT_HAVE_STDARG_H +#ifdef EVENT__HAVE_STDARG_H #include #endif @@ -307,7 +307,7 @@ bufferevent_init_common(struct bufferevent_private *bufev_private, */ bufev->enabled = EV_WRITE; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (options & BEV_OPT_THREADSAFE) { if (bufferevent_enable_locking(bufev, NULL) < 0) { /* cleanup */ @@ -718,7 +718,7 @@ bufferevent_incref(struct bufferevent *bufev) int bufferevent_enable_locking(struct bufferevent *bufev, void *lock) { -#ifdef _EVENT_DISABLE_THREAD_SUPPORT +#ifdef EVENT__DISABLE_THREAD_SUPPORT return -1; #else struct bufferevent *underlying; diff --git a/bufferevent_async.c b/bufferevent_async.c index b28e4b6298..32cb477933 100644 --- a/bufferevent_async.c +++ b/bufferevent_async.c @@ -29,7 +29,7 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -37,10 +37,10 @@ #include #include #include -#ifdef _EVENT_HAVE_STDARG_H +#ifdef EVENT__HAVE_STDARG_H #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif diff --git a/bufferevent_filter.c b/bufferevent_filter.c index bc70f8eb98..b605600af2 100644 --- a/bufferevent_filter.c +++ b/bufferevent_filter.c @@ -32,7 +32,7 @@ #include "event2/event-config.h" -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -40,7 +40,7 @@ #include #include #include -#ifdef _EVENT_HAVE_STDARG_H +#ifdef EVENT__HAVE_STDARG_H #include #endif diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 090927daf0..c735a98e76 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -29,7 +29,7 @@ #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -37,10 +37,10 @@ #include #include #include -#ifdef _EVENT_HAVE_STDARG_H +#ifdef EVENT__HAVE_STDARG_H #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif diff --git a/bufferevent_sock.c b/bufferevent_sock.c index 431ece0588..a117af85c0 100644 --- a/bufferevent_sock.c +++ b/bufferevent_sock.c @@ -31,7 +31,7 @@ #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -39,10 +39,10 @@ #include #include #include -#ifdef _EVENT_HAVE_STDARG_H +#ifdef EVENT__HAVE_STDARG_H #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif @@ -51,13 +51,13 @@ #include #endif -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif -#ifdef _EVENT_HAVE_NETINET_IN_H +#ifdef EVENT__HAVE_NETINET_IN_H #include #endif -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif diff --git a/devpoll.c b/devpoll.c index 4be46e400d..27fa039ee9 100644 --- a/devpoll.c +++ b/devpoll.c @@ -27,11 +27,11 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_DEVPOLL +#ifdef EVENT__HAVE_DEVPOLL #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -308,4 +308,4 @@ devpoll_dealloc(struct event_base *base) mm_free(devpollop); } -#endif /* _EVENT_HAVE_DEVPOLL */ +#endif /* EVENT__HAVE_DEVPOLL */ diff --git a/epoll.c b/epoll.c index ab9cff4c03..d059a1874e 100644 --- a/epoll.c +++ b/epoll.c @@ -27,12 +27,12 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_EPOLL +#ifdef EVENT__HAVE_EPOLL #include #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -44,7 +44,7 @@ #include #include #include -#ifdef _EVENT_HAVE_FCNTL_H +#ifdef EVENT__HAVE_FCNTL_H #include #endif @@ -113,7 +113,7 @@ epoll_init(struct event_base *base) int epfd = -1; struct epollop *epollop; -#ifdef _EVENT_HAVE_EPOLL_CREATE1 +#ifdef EVENT__HAVE_EPOLL_CREATE1 /* First, try the shiny new epoll_create1 interface, if we have it. */ epfd = epoll_create1(EPOLL_CLOEXEC); #endif @@ -590,4 +590,4 @@ epoll_dealloc(struct event_base *base) mm_free(epollop); } -#endif /* _EVENT_HAVE_EPOLL */ +#endif /* EVENT__HAVE_EPOLL */ diff --git a/evbuffer-internal.h b/evbuffer-internal.h index bdbde89e6e..426955df13 100644 --- a/evbuffer-internal.h +++ b/evbuffer-internal.h @@ -50,7 +50,7 @@ extern "C" { /* Minimum allocation for a chain. We define this so that we're burning no * more than 5% of each allocation on overhead. It would be nice to lose even * less space, though. */ -#if _EVENT_SIZEOF_VOID_P < 8 +#if EVENT__SIZEOF_VOID_P < 8 #define MIN_BUFFER_SIZE 512 #else #define MIN_BUFFER_SIZE 1024 @@ -107,7 +107,7 @@ struct evbuffer { * tried to invoke callbacks. */ size_t n_del_for_cb; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT /** A lock used to mediate access to this buffer. */ void *lock; #endif diff --git a/evdns.c b/evdns.c index 7ad3d09db9..f7cb30f2d4 100644 --- a/evdns.c +++ b/evdns.c @@ -59,16 +59,16 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_STDINT_H +#ifdef EVENT__HAVE_STDINT_H #include #endif #include #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include @@ -115,7 +115,7 @@ #include #endif -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif @@ -253,7 +253,7 @@ struct evdns_server_port { struct server_request *pending_replies; struct event_base *event_base; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT void *lock; #endif }; @@ -355,7 +355,7 @@ struct evdns_base { TAILQ_HEAD(hosts_list, hosts_entry) hostsdb; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT void *lock; #endif }; @@ -413,7 +413,7 @@ static void evdns_base_free_and_unlock(struct evdns_base *base, int fail_request static int strtoint(const char *const str); -#ifdef _EVENT_DISABLE_THREAD_SUPPORT +#ifdef EVENT__DISABLE_THREAD_SUPPORT #define EVDNS_LOCK(base) _EVUTIL_NIL_STMT #define EVDNS_UNLOCK(base) _EVUTIL_NIL_STMT #define ASSERT_LOCKED(base) _EVUTIL_NIL_STMT @@ -2140,7 +2140,7 @@ evdns_server_request_get_requesting_addr(struct evdns_server_request *_req, stru static void evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) { struct request *const req = (struct request *) arg; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT struct evdns_base *base = req->base; #endif (void) fd; @@ -3229,7 +3229,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 _EVENT_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 bce9c386d0..ebd5002be2 100644 --- a/event-internal.h +++ b/event-internal.h @@ -162,7 +162,7 @@ struct event_changelist { int changes_size; }; -#ifndef _EVENT_DISABLE_DEBUG_MODE +#ifndef EVENT__DISABLE_DEBUG_MODE /* Global internal flag: set to one if debug mode is on. */ extern int _event_debug_mode_on; #define EVENT_DEBUG_MODE_IS_ON() (_event_debug_mode_on) @@ -243,7 +243,7 @@ struct event_base { * too often. */ struct timeval tv_cache; -#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) /** Difference between internal time (maybe from clock_gettime) and * gettimeofday. */ struct timeval tv_clock_diff; @@ -251,7 +251,7 @@ struct event_base { time_t last_updated_clock_diff; #endif -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT /* threading support */ /** The thread currently running the event_loop for this base */ unsigned long th_owner_id; @@ -312,7 +312,7 @@ struct event_config { }; /* Internal use only: Functions that might be missing from */ -#if defined(_EVENT_HAVE_SYS_QUEUE_H) && !defined(_EVENT_HAVE_TAILQFOREACH) +#if defined(EVENT__HAVE_SYS_QUEUE_H) && !defined(EVENT__HAVE_TAILQFOREACH) #ifndef TAILQ_FIRST #define TAILQ_FIRST(head) ((head)->tqh_first) #endif diff --git a/event.c b/event.c index d9fa1abc5b..58734bc436 100644 --- a/event.c +++ b/event.c @@ -34,16 +34,16 @@ #undef WIN32_LEAN_AND_MEAN #endif #include -#if !defined(_WIN32) && defined(_EVENT_HAVE_SYS_TIME_H) +#if !defined(_WIN32) && defined(EVENT__HAVE_SYS_TIME_H) #include #endif #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include @@ -69,22 +69,22 @@ #include "ht-internal.h" #include "util-internal.h" -#ifdef _EVENT_HAVE_EVENT_PORTS +#ifdef EVENT__HAVE_EVENT_PORTS extern const struct eventop evportops; #endif -#ifdef _EVENT_HAVE_SELECT +#ifdef EVENT__HAVE_SELECT extern const struct eventop selectops; #endif -#ifdef _EVENT_HAVE_POLL +#ifdef EVENT__HAVE_POLL extern const struct eventop pollops; #endif -#ifdef _EVENT_HAVE_EPOLL +#ifdef EVENT__HAVE_EPOLL extern const struct eventop epollops; #endif -#ifdef _EVENT_HAVE_WORKING_KQUEUE +#ifdef EVENT__HAVE_WORKING_KQUEUE extern const struct eventop kqops; #endif -#ifdef _EVENT_HAVE_DEVPOLL +#ifdef EVENT__HAVE_DEVPOLL extern const struct eventop devpollops; #endif #ifdef _WIN32 @@ -93,22 +93,22 @@ extern const struct eventop win32ops; /* Array of backends in order of preference. */ static const struct eventop *eventops[] = { -#ifdef _EVENT_HAVE_EVENT_PORTS +#ifdef EVENT__HAVE_EVENT_PORTS &evportops, #endif -#ifdef _EVENT_HAVE_WORKING_KQUEUE +#ifdef EVENT__HAVE_WORKING_KQUEUE &kqops, #endif -#ifdef _EVENT_HAVE_EPOLL +#ifdef EVENT__HAVE_EPOLL &epollops, #endif -#ifdef _EVENT_HAVE_DEVPOLL +#ifdef EVENT__HAVE_DEVPOLL &devpollops, #endif -#ifdef _EVENT_HAVE_POLL +#ifdef EVENT__HAVE_POLL &pollops, #endif -#ifdef _EVENT_HAVE_SELECT +#ifdef EVENT__HAVE_SELECT &selectops, #endif #ifdef _WIN32 @@ -154,7 +154,7 @@ static int evthread_notify_base(struct event_base *base); static void insert_common_timeout_inorder(struct common_timeout_list *ctl, struct event *ev); -#ifndef _EVENT_DISABLE_DEBUG_MODE +#ifndef EVENT__DISABLE_DEBUG_MODE /* These functions implement a hashtable of which 'struct event *' structures * have been setup or added. We don't want to trust the content of the struct * event itself, since we're trying to work through cases where an event gets @@ -191,7 +191,7 @@ eq_debug_entry(const struct event_debug_entry *a, int _event_debug_mode_on = 0; /* Set if it's too late to enable event_debug_mode. */ static int event_debug_mode_too_late = 0; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT static void *_event_debug_map_lock = NULL; #endif static HT_HEAD(event_debug_map, event_debug_entry) global_debug_map = @@ -335,7 +335,7 @@ HT_GENERATE(event_debug_map, event_debug_entry, node, hash_debug_entry, static void detect_monotonic(void) { -#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) struct timespec ts; static int use_monotonic_initialized = 0; @@ -368,7 +368,7 @@ gettime(struct event_base *base, struct timeval *tp) return (0); } -#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) if (use_monotonic) { struct timespec ts; @@ -406,7 +406,7 @@ event_base_gettimeofday_cached(struct event_base *base, struct timeval *tv) if (base->tv_cache.tv_sec == 0) { r = evutil_gettimeofday(tv, NULL); } else { -#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) evutil_timeradd(&base->tv_cache, &base->tv_clock_diff, tv); #else *tv = base->tv_cache; @@ -539,7 +539,7 @@ event_base_get_deferred_cb_queue(struct event_base *base) void event_enable_debug_mode(void) { -#ifndef _EVENT_DISABLE_DEBUG_MODE +#ifndef EVENT__DISABLE_DEBUG_MODE if (_event_debug_mode_on) event_errx(1, "%s was called twice!", __func__); if (event_debug_mode_too_late) @@ -576,7 +576,7 @@ event_base_new_with_config(const struct event_config *cfg) struct event_base *base; int should_check_environment; -#ifndef _EVENT_DISABLE_DEBUG_MODE +#ifndef EVENT__DISABLE_DEBUG_MODE event_debug_mode_too_late = 1; #endif @@ -668,7 +668,7 @@ event_base_new_with_config(const struct event_config *cfg) /* prepare for threading */ -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (EVTHREAD_LOCKING_ENABLED() && (!cfg || !(cfg->flags & EVENT_BASE_FLAG_NOLOCK))) { int r; @@ -1423,7 +1423,7 @@ event_process_active_single_queue(struct event_base *base, ev->ev_res & EV_WRITE ? "EV_WRITE " : " ", ev->ev_callback)); -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT base->current_event = ev; base->current_event_waiters = 0; #endif @@ -1444,7 +1444,7 @@ event_process_active_single_queue(struct event_base *base, } EVBASE_ACQUIRE_LOCK(base, th_base_lock); -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT base->current_event = NULL; if (base->current_event_waiters) { base->current_event_waiters = 0; @@ -1684,7 +1684,7 @@ event_base_loop(struct event_base *base, int flags) done = 0; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT base->th_owner_id = EVTHREAD_GET_ID(); #endif @@ -1990,7 +1990,7 @@ event_pending(const struct event *ev, short event, struct timeval *tv) if (tv != NULL && (flags & event & EV_TIMEOUT)) { struct timeval tmp = ev->ev_timeout; tmp.tv_usec &= MICROSECONDS_MASK; -#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) /* correctly remamp to real time */ evutil_timeradd(&ev->ev_base->tv_clock_diff, &tmp, tv); #else @@ -2174,7 +2174,7 @@ event_add_internal(struct event *ev, const struct timeval *tv, * callback, and we are not the main thread, then we want to wait * until the callback is done before we mess with the event, or else * we can race on ev_ncalls and ev_pncalls below. */ -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (base->current_event == ev && (ev->ev_events & EV_SIGNAL) && !EVBASE_IN_THREAD(base)) { ++base->current_event_waiters; @@ -2319,7 +2319,7 @@ event_del_internal(struct event *ev) * when this function returns, it will be safe to free the * user-supplied argument. */ base = ev->ev_base; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (base->current_event == ev && !EVBASE_IN_THREAD(base)) { ++base->current_event_waiters; EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock); @@ -2412,7 +2412,7 @@ event_active_nolock(struct event *ev, int res, short ncalls) ev->ev_res = res; if (ev->ev_events & EV_SIGNAL) { -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (base->current_event == ev && !EVBASE_IN_THREAD(base)) { ++base->current_event_waiters; EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock); @@ -2776,13 +2776,13 @@ event_queue_insert_timeout(struct event_base *base, struct event *ev) const char * event_get_version(void) { - return (_EVENT_VERSION); + return (EVENT__VERSION); } ev_uint32_t event_get_version_number(void) { - return (_EVENT_NUMERIC_VERSION); + return (EVENT__NUMERIC_VERSION); } /* @@ -2796,7 +2796,7 @@ event_get_method(void) return (current_base->evsel->name); } -#ifndef _EVENT_DISABLE_MM_REPLACEMENT +#ifndef EVENT__DISABLE_MM_REPLACEMENT static void *(*_mm_malloc_fn)(size_t sz) = NULL; static void *(*_mm_realloc_fn)(void *p, size_t sz) = NULL; static void (*_mm_free_fn)(void *p) = NULL; @@ -3052,7 +3052,7 @@ dump_inserted_event_fn(struct event_base *base, struct event *e, void *arg) struct timeval tv; tv.tv_sec = e->ev_timeout.tv_sec; tv.tv_usec = e->ev_timeout.tv_usec & MICROSECONDS_MASK; -#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) +#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) evutil_timeradd(&tv, &base->tv_clock_diff, &tv); #endif fprintf(output, " Timeout=%ld.%06d", @@ -3114,11 +3114,11 @@ event_base_del_virtual(struct event_base *base) EVBASE_RELEASE_LOCK(base, th_base_lock); } -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT int event_global_setup_locks_(const int enable_locks) { -#ifndef _EVENT_DISABLE_DEBUG_MODE +#ifndef EVENT__DISABLE_DEBUG_MODE EVTHREAD_SETUP_GLOBAL_LOCK(_event_debug_map_lock, 0); #endif if (evsig_global_setup_locks_(enable_locks) < 0) diff --git a/event_tagging.c b/event_tagging.c index 6bd922bbb5..7edd3da5d9 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -28,10 +28,10 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_PARAM_H +#ifdef EVENT__HAVE_SYS_PARAM_H #include #endif @@ -45,7 +45,7 @@ #endif #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -56,7 +56,7 @@ #ifndef _WIN32 #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include diff --git a/evmap.c b/evmap.c index 2a4f4244cd..debebf6edc 100644 --- a/evmap.c +++ b/evmap.c @@ -33,7 +33,7 @@ #undef WIN32_LEAN_AND_MEAN #endif #include -#if !defined(_WIN32) && defined(_EVENT_HAVE_SYS_TIME_H) +#if !defined(_WIN32) && defined(EVENT__HAVE_SYS_TIME_H) #include #endif #include diff --git a/evport.c b/evport.c index d95d933d8a..7f3b394729 100644 --- a/evport.c +++ b/evport.c @@ -56,7 +56,7 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_EVENT_PORTS +#ifdef EVENT__HAVE_EVENT_PORTS #include #include @@ -448,4 +448,4 @@ evport_dealloc(struct event_base *base) mm_free(evpd); } -#endif /* _EVENT_HAVE_EVENT_PORTS */ +#endif /* EVENT__HAVE_EVENT_PORTS */ diff --git a/evrpc.c b/evrpc.c index 03bd375476..1643e7de47 100644 --- a/evrpc.c +++ b/evrpc.c @@ -38,7 +38,7 @@ #ifndef _WIN32 #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include diff --git a/evsignal-internal.h b/evsignal-internal.h index 426f4a4d23..45566144a1 100644 --- a/evsignal-internal.h +++ b/evsignal-internal.h @@ -48,7 +48,7 @@ struct evsig_info { /* Array of previous signal handler objects before Libevent started * messing with them. Used to restore old signal handlers. */ -#ifdef _EVENT_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 26a26da149..0a139d4b20 100644 --- a/evthread-internal.h +++ b/evthread-internal.h @@ -46,7 +46,7 @@ struct event_base; #define EVTHREAD_EXPOSE_STRUCTS #endif -#if ! defined(_EVENT_DISABLE_THREAD_SUPPORT) && defined(EVTHREAD_EXPOSE_STRUCTS) +#if ! defined(EVENT__DISABLE_THREAD_SUPPORT) && defined(EVTHREAD_EXPOSE_STRUCTS) /* Global function pointers to lock-related functions. NULL if locking isn't enabled. */ extern struct evthread_lock_callbacks _evthread_lock_fns; @@ -179,7 +179,7 @@ EVLOCK_TRY_LOCK(void *lock) #define EVTHREAD_LOCKING_ENABLED() \ (_evthread_lock_fns.lock != NULL) -#elif ! defined(_EVENT_DISABLE_THREAD_SUPPORT) +#elif ! defined(EVENT__DISABLE_THREAD_SUPPORT) unsigned long _evthreadimpl_get_id(void); int _evthreadimpl_is_lock_debugging_enabled(void); @@ -291,7 +291,7 @@ EVLOCK_TRY_LOCK(void *lock) #define EVTHREAD_LOCKING_ENABLED() \ (_evthreadimpl_locking_enabled()) -#else /* _EVENT_DISABLE_THREAD_SUPPORT */ +#else /* EVENT__DISABLE_THREAD_SUPPORT */ #define EVTHREAD_GET_ID() 1 #define EVTHREAD_ALLOC_LOCK(lockvar, locktype) _EVUTIL_NIL_STMT @@ -322,7 +322,7 @@ EVLOCK_TRY_LOCK(void *lock) #endif /* This code is shared between both lock impls */ -#if ! defined(_EVENT_DISABLE_THREAD_SUPPORT) +#if ! defined(EVENT__DISABLE_THREAD_SUPPORT) /** Helper: put lockvar1 and lockvar2 into pointerwise ascending order. */ #define _EVLOCK_SORTLOCKS(lockvar1, lockvar2) \ do { \ diff --git a/evthread.c b/evthread.c index c20ab24395..f66df77389 100644 --- a/evthread.c +++ b/evthread.c @@ -27,7 +27,7 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT #include "event2/thread.h" diff --git a/evthread_pthread.c b/evthread_pthread.c index 24a8639e78..c577f8909a 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -87,13 +87,13 @@ evthread_posix_get_id(void) { union { pthread_t thr; -#if _EVENT_SIZEOF_PTHREAD_T > _EVENT_SIZEOF_LONG +#if EVENT__SIZEOF_PTHREAD_T > EVENT__SIZEOF_LONG ev_uint64_t id; #else unsigned long id; #endif } r; -#if _EVENT_SIZEOF_PTHREAD_T < _EVENT_SIZEOF_LONG +#if EVENT__SIZEOF_PTHREAD_T < EVENT__SIZEOF_LONG memset(&r, 0, sizeof(r)); #endif r.thr = pthread_self(); diff --git a/evutil.c b/evutil.c index dcfc77e8b1..b105c95f16 100644 --- a/evutil.c +++ b/evutil.c @@ -42,44 +42,44 @@ #endif #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif -#ifdef _EVENT_HAVE_FCNTL_H +#ifdef EVENT__HAVE_FCNTL_H #include #endif -#ifdef _EVENT_HAVE_STDLIB_H +#ifdef EVENT__HAVE_STDLIB_H #include #endif #include #include #include #include -#ifdef _EVENT_HAVE_NETINET_IN_H +#ifdef EVENT__HAVE_NETINET_IN_H #include #endif -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif -#ifdef _EVENT_HAVE_NETINET_TCP_H +#ifdef EVENT__HAVE_NETINET_TCP_H #include #endif -#ifdef _EVENT_HAVE_ARPA_INET_H +#ifdef EVENT__HAVE_ARPA_INET_H #include #endif -#if !defined(_EVENT_HAVE_NANOSLEEP) && !defined(EVENT_HAVE_USLEEP) && \ +#if !defined(EVENT__HAVE_NANOSLEEP) && !defined(EVENT_HAVE_USLEEP) && \ !defined(_WIN32) #include #endif -#ifndef _EVENT_HAVE_GETTIMEOFDAY +#ifndef EVENT__HAVE_GETTIMEOFDAY #include #include #endif #include -#ifdef _EVENT_HAVE_IFADDRS_H +#ifdef EVENT__HAVE_IFADDRS_H #include #endif @@ -370,7 +370,7 @@ evutil_make_listen_socket_reuseable(evutil_socket_t sock) int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock) { -#if defined(_EVENT_HAVE_NETINET_TCP_H) && defined(TCP_DEFER_ACCEPT) +#if defined(EVENT__HAVE_NETINET_TCP_H) && defined(TCP_DEFER_ACCEPT) int one = 1; /* TCP_DEFER_ACCEPT tells the kernel to call defer accept() only after data @@ -384,7 +384,7 @@ evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock) int evutil_make_socket_closeonexec(evutil_socket_t fd) { -#if !defined(_WIN32) && defined(_EVENT_HAVE_SETFD) +#if !defined(_WIN32) && defined(EVENT__HAVE_SETFD) int flags; if ((flags = fcntl(fd, F_GETFD, NULL)) < 0) { event_warn("fcntl(%d, F_GETFD)", fd); @@ -405,7 +405,7 @@ evutil_make_socket_closeonexec(evutil_socket_t fd) static int evutil_fast_socket_closeonexec(evutil_socket_t fd) { -#if !defined(_WIN32) && defined(_EVENT_HAVE_SETFD) +#if !defined(_WIN32) && defined(EVENT__HAVE_SETFD) if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { event_warn("fcntl(%d, F_SETFD)", fd); return -1; @@ -427,9 +427,9 @@ evutil_closesocket(evutil_socket_t sock) ev_int64_t evutil_strtoll(const char *s, char **endptr, int base) { -#ifdef _EVENT_HAVE_STRTOLL +#ifdef EVENT__HAVE_STRTOLL return (ev_int64_t)strtoll(s, endptr, base); -#elif _EVENT_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 @@ -449,7 +449,7 @@ evutil_strtoll(const char *s, char **endptr, int base) return r; #elif defined(_WIN32) return (ev_int64_t) _strtoi64(s, endptr, base); -#elif defined(_EVENT_SIZEOF_LONG_LONG) && _EVENT_SIZEOF_LONG_LONG == 8 +#elif defined(EVENT__SIZEOF_LONG_LONG) && EVENT__SIZEOF_LONG_LONG == 8 long long r; int n; if (base != 10 && base != 16) @@ -484,7 +484,7 @@ evutil_strtoll(const char *s, char **endptr, int base) #endif } -#ifndef _EVENT_HAVE_GETTIMEOFDAY +#ifndef EVENT__HAVE_GETTIMEOFDAY /* No gettimeofday; this must be windows. */ int evutil_gettimeofday(struct timeval *tv, struct timezone *tz) @@ -667,7 +667,7 @@ typedef ULONG (WINAPI *GetAdaptersAddresses_fn_t)( static int evutil_check_ifaddrs(void) { -#if defined(_EVENT_HAVE_GETIFADDRS) +#if defined(EVENT__HAVE_GETIFADDRS) /* Most free Unixy systems provide getifaddrs, which gives us a linked list * of struct ifaddrs. */ struct ifaddrs *ifa = NULL; @@ -898,7 +898,7 @@ evutil_parse_servname(const char *servname, const char *protocol, int n = parse_numeric_servname(servname); if (n>=0) return n; -#if defined(_EVENT_HAVE_GETSERVBYNAME) || defined(_WIN32) +#if defined(EVENT__HAVE_GETSERVBYNAME) || defined(_WIN32) if (!(hints->ai_flags & EVUTIL_AI_NUMERICSERV)) { struct servent *ent = getservbyname(servname, protocol); if (ent) { @@ -926,7 +926,7 @@ evutil_unparse_protoname(int proto) return "sctp"; #endif default: -#ifdef _EVENT_HAVE_GETPROTOBYNUMBER +#ifdef EVENT__HAVE_GETPROTOBYNUMBER { struct protoent *ent = getprotobynumber(proto); if (ent) @@ -1095,7 +1095,7 @@ evutil_getaddrinfo_common(const char *nodename, const char *servname, return EVUTIL_EAI_NEED_RESOLVE; } -#ifdef _EVENT_HAVE_GETADDRINFO +#ifdef EVENT__HAVE_GETADDRINFO #define USE_NATIVE_GETADDRINFO #endif @@ -1473,19 +1473,19 @@ evutil_getaddrinfo(const char *nodename, const char *servname, err = 0; /* Use any of the various gethostbyname_r variants as available. */ { -#ifdef _EVENT_HAVE_GETHOSTBYNAME_R_6_ARG +#ifdef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG /* This one is what glibc provides. */ char buf[2048]; struct hostent hostent; int r; r = gethostbyname_r(nodename, &hostent, buf, sizeof(buf), &ent, &err); -#elif defined(_EVENT_HAVE_GETHOSTBYNAME_R_5_ARG) +#elif defined(EVENT__HAVE_GETHOSTBYNAME_R_5_ARG) char buf[2048]; struct hostent hostent; ent = gethostbyname_r(nodename, &hostent, buf, sizeof(buf), &err); -#elif defined(_EVENT_HAVE_GETHOSTBYNAME_R_3_ARG) +#elif defined(EVENT__HAVE_GETHOSTBYNAME_R_3_ARG) struct hostent_data data; struct hostent hostent; memset(&data, 0, sizeof(data)); @@ -1550,7 +1550,7 @@ evutil_getaddrinfo(const char *nodename, const char *servname, void evutil_freeaddrinfo(struct evutil_addrinfo *ai) { -#ifdef _EVENT_HAVE_GETADDRINFO +#ifdef EVENT__HAVE_GETADDRINFO if (!(ai->ai_flags & EVUTIL_AI_LIBEVENT_ALLOCATED)) { freeaddrinfo(ai); return; @@ -1759,7 +1759,7 @@ evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap) const char * evutil_inet_ntop(int af, const void *src, char *dst, size_t len) { -#if defined(_EVENT_HAVE_INET_NTOP) && !defined(USE_INTERNAL_NTOP) +#if defined(EVENT__HAVE_INET_NTOP) && !defined(USE_INTERNAL_NTOP) return inet_ntop(af, src, dst, len); #else if (af == AF_INET) { @@ -1855,7 +1855,7 @@ evutil_inet_ntop(int af, const void *src, char *dst, size_t len) int evutil_inet_pton(int af, const char *src, void *dst) { -#if defined(_EVENT_HAVE_INET_PTON) && !defined(USE_INTERNAL_PTON) +#if defined(EVENT__HAVE_INET_PTON) && !defined(USE_INTERNAL_PTON) return inet_pton(af, src, dst); #else if (af == AF_INET) { @@ -2032,7 +2032,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int * { struct sockaddr_in6 sin6; memset(&sin6, 0, sizeof(sin6)); -#ifdef _EVENT_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; @@ -2051,7 +2051,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int * { struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); -#ifdef _EVENT_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; @@ -2247,15 +2247,15 @@ int evutil_ascii_strncasecmp(const char *s1, const char *s2, size_t n) static int evutil_issetugid(void) { -#ifdef _EVENT_HAVE_ISSETUGID +#ifdef EVENT__HAVE_ISSETUGID return issetugid(); #else -#ifdef _EVENT_HAVE_GETEUID +#ifdef EVENT__HAVE_GETEUID if (getuid() != geteuid()) return 1; #endif -#ifdef _EVENT_HAVE_GETEGID +#ifdef EVENT__HAVE_GETEGID if (getgid() != getegid()) return 1; #endif @@ -2366,7 +2366,7 @@ evutil_usleep(const struct timeval *tv) ts.tv_nsec = tv->tv_usec*1000; nanosleep(&ts, NULL); } -#elif defined(_EVENT_HAVE_USLEEP) +#elif defined(EVENT__HAVE_USLEEP) /* Some systems don't like to usleep more than 999999 usec */ sleep(tv->tv_sec); usleep(tv->tv_usec); @@ -2426,7 +2426,7 @@ evutil_accept4(evutil_socket_t sockfd, struct sockaddr *addr, ev_socklen_t *addrlen, int flags) { evutil_socket_t result; -#if defined(_EVENT_HAVE_ACCEPT4) && defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK) +#if defined(EVENT__HAVE_ACCEPT4) && defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK) result = accept4(sockfd, addr, addrlen, flags); if (result >= 0 || errno != EINVAL) return result; @@ -2466,11 +2466,11 @@ evutil_make_internal_pipe(evutil_socket_t fd[2]) or woken up and in the process of draining it. */ -#if defined(_EVENT_HAVE_PIPE2) +#if defined(EVENT__HAVE_PIPE2) if (pipe2(fd, O_NONBLOCK|O_CLOEXEC) == 0) return 0; #endif -#if defined(_EVENT_HAVE_PIPE) +#if defined(EVENT__HAVE_PIPE) if (pipe(fd) == 0) { if (evutil_fast_socket_nonblocking(fd[0]) < 0 || evutil_fast_socket_nonblocking(fd[1]) < 0 || @@ -2515,7 +2515,7 @@ evutil_make_internal_pipe(evutil_socket_t fd[2]) evutil_socket_t evutil_eventfd(unsigned initval, int flags) { -#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H) +#if defined(EVENT__HAVE_EVENTFD) && defined(EVENT__HAVE_SYS_EVENTFD_H) int r; #if defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK) r = eventfd(initval, flags); diff --git a/evutil_rand.c b/evutil_rand.c index b8623876a3..dac601890e 100644 --- a/evutil_rand.c +++ b/evutil_rand.c @@ -40,7 +40,7 @@ #include "util-internal.h" #include "evthread-internal.h" -#ifdef _EVENT_HAVE_ARC4RANDOM +#ifdef EVENT__HAVE_ARC4RANDOM #include #include int @@ -59,7 +59,7 @@ evutil_secure_rng_global_setup_locks_(const int enable_locks) static void ev_arc4random_buf(void *buf, size_t n) { -#ifdef _EVENT_HAVE_ARC4RANDOM_BUF +#ifdef EVENT__HAVE_ARC4RANDOM_BUF return arc4random_buf(buf, n); #else unsigned char *b = buf; @@ -84,15 +84,15 @@ ev_arc4random_buf(void *buf, size_t n) #endif } -#else /* !_EVENT_HAVE_ARC4RANDOM { */ +#else /* !EVENT__HAVE_ARC4RANDOM { */ -#ifdef _EVENT_ssize_t +#ifdef EVENT__ssize_t #define ssize_t _EVENT_SSIZE_t #endif #define ARC4RANDOM_EXPORT static #define _ARC4_LOCK() EVLOCK_LOCK(arc4rand_lock, 0) #define _ARC4_UNLOCK() EVLOCK_UNLOCK(arc4rand_lock, 0) -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT static void *arc4rand_lock; #endif @@ -103,7 +103,7 @@ static void *arc4rand_lock; #include "./arc4random.c" -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT int evutil_secure_rng_global_setup_locks_(const int enable_locks) { @@ -131,7 +131,7 @@ ev_arc4random_buf(void *buf, size_t n) arc4random_buf(buf, n); } -#endif /* } !_EVENT_HAVE_ARC4RANDOM */ +#endif /* } !EVENT__HAVE_ARC4RANDOM */ void evutil_secure_rng_get_bytes(void *buf, size_t n) diff --git a/http.c b/http.c index 632735c998..a6d6ba5c67 100644 --- a/http.c +++ b/http.c @@ -28,14 +28,14 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_SYS_PARAM_H +#ifdef EVENT__HAVE_SYS_PARAM_H #include #endif -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_IOCCOM_H @@ -54,13 +54,13 @@ #include -#ifdef _EVENT_HAVE_NETINET_IN_H +#ifdef EVENT__HAVE_NETINET_IN_H #include #endif -#ifdef _EVENT_HAVE_ARPA_INET_H +#ifdef EVENT__HAVE_ARPA_INET_H #include #endif -#ifdef _EVENT_HAVE_NETDB_H +#ifdef EVENT__HAVE_NETDB_H #include #endif @@ -77,10 +77,10 @@ #endif #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif -#ifdef _EVENT_HAVE_FCNTL_H +#ifdef EVENT__HAVE_FCNTL_H #include #endif @@ -102,7 +102,7 @@ #include "mm-internal.h" #include "bufferevent-internal.h" -#ifndef _EVENT_HAVE_GETNAMEINFO +#ifndef EVENT__HAVE_GETNAMEINFO #define NI_MAXSERV 32 #define NI_MAXHOST 1025 @@ -198,7 +198,7 @@ static int evhttp_decode_uri_internal(const char *uri, size_t length, static int evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp, const char *hostname); -#ifndef _EVENT_HAVE_STRSEP +#ifndef EVENT__HAVE_STRSEP /* strsep replacement for platforms that lack it. Only works if * del is one character long. */ static char * @@ -3946,7 +3946,7 @@ name_from_addr(struct sockaddr *sa, ev_socklen_t salen, char strport[NI_MAXSERV]; int ni_result; -#ifdef _EVENT_HAVE_GETNAMEINFO +#ifdef EVENT__HAVE_GETNAMEINFO ni_result = getnameinfo(sa, salen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV); diff --git a/include/event.h b/include/event.h index 45250b379c..e063420165 100644 --- a/include/event.h +++ b/include/event.h @@ -42,13 +42,13 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_STDINT_H +#ifdef EVENT__HAVE_STDINT_H #include #endif #include diff --git a/include/event2/buffer.h b/include/event2/buffer.h index d152f3fed6..2e3b0f46e3 100644 --- a/include/event2/buffer.h +++ b/include/event2/buffer.h @@ -78,10 +78,10 @@ extern "C" { #include #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_UIO_H +#ifdef EVENT__HAVE_SYS_UIO_H #include #endif #include @@ -132,7 +132,7 @@ struct evbuffer_ptr { @see evbuffer_reserve_space, evbuffer_commit_space, evbuffer_peek */ -#ifdef _EVENT_HAVE_SYS_UIO_H +#ifdef EVENT__HAVE_SYS_UIO_H #define evbuffer_iovec iovec /* Internal use -- defined only if we are using the native struct iovec */ #define _EVBUFFER_IOVEC_IS_NATIVE diff --git a/include/event2/bufferevent.h b/include/event2/bufferevent.h index 56fc7dceb1..a7d360d517 100644 --- a/include/event2/bufferevent.h +++ b/include/event2/bufferevent.h @@ -79,10 +79,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/bufferevent_ssl.h b/include/event2/bufferevent_ssl.h index 07608faf11..f32a035f81 100644 --- a/include/event2/bufferevent_ssl.h +++ b/include/event2/bufferevent_ssl.h @@ -52,7 +52,7 @@ enum bufferevent_ssl_state { BUFFEREVENT_SSL_ACCEPTING = 2 }; -#if defined(_EVENT_HAVE_OPENSSL) || defined(_EVENT_IN_DOXYGEN) +#if defined(EVENT__HAVE_OPENSSL) || defined(_EVENT_IN_DOXYGEN) /** Create a new SSL bufferevent to send its data over another bufferevent. diff --git a/include/event2/bufferevent_struct.h b/include/event2/bufferevent_struct.h index 02835c1635..cfac3127c5 100644 --- a/include/event2/bufferevent_struct.h +++ b/include/event2/bufferevent_struct.h @@ -42,10 +42,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/dns_compat.h b/include/event2/dns_compat.h index 88bf97b509..1469a014df 100644 --- a/include/event2/dns_compat.h +++ b/include/event2/dns_compat.h @@ -40,10 +40,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/dns_struct.h b/include/event2/dns_struct.h index 5a02a0bdff..620c66ec89 100644 --- a/include/event2/dns_struct.h +++ b/include/event2/dns_struct.h @@ -39,10 +39,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/event.h b/include/event2/event.h index 6387dc7b90..8ab34da186 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -185,10 +185,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif @@ -1130,10 +1130,10 @@ const char *event_get_version(void); ev_uint32_t event_get_version_number(void); /** As event_get_version, but gives the version of Libevent's headers. */ -#define LIBEVENT_VERSION _EVENT_VERSION +#define LIBEVENT_VERSION EVENT__VERSION /** As event_get_version_number, but gives the version number of Libevent's * headers. */ -#define LIBEVENT_VERSION_NUMBER _EVENT_NUMERIC_VERSION +#define LIBEVENT_VERSION_NUMBER EVENT__NUMERIC_VERSION /** Largest number of priorities that Libevent can support. */ #define EVENT_MAX_PRIORITIES 256 @@ -1207,7 +1207,7 @@ int event_priority_set(struct event *, int); const struct timeval *event_base_init_common_timeout(struct event_base *base, const struct timeval *duration); -#if !defined(_EVENT_DISABLE_MM_REPLACEMENT) || defined(_EVENT_IN_DOXYGEN) +#if !defined(EVENT__DISABLE_MM_REPLACEMENT) || defined(_EVENT_IN_DOXYGEN) /** Override the functions that Libevent uses for memory management. diff --git a/include/event2/event_compat.h b/include/event2/event_compat.h index 14a10e9e9a..a1d2f252dc 100644 --- a/include/event2/event_compat.h +++ b/include/event2/event_compat.h @@ -47,10 +47,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/event_struct.h b/include/event2/event_struct.h index 2da11e2ffc..714a6cd0fc 100644 --- a/include/event2/event_struct.h +++ b/include/event2/event_struct.h @@ -41,10 +41,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/http_compat.h b/include/event2/http_compat.h index 9e902a4b70..c29c48e947 100644 --- a/include/event2/http_compat.h +++ b/include/event2/http_compat.h @@ -39,10 +39,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/http_struct.h b/include/event2/http_struct.h index 41a92a9f52..75f7d9dde4 100644 --- a/include/event2/http_struct.h +++ b/include/event2/http_struct.h @@ -39,10 +39,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/tag.h b/include/event2/tag.h index 9e51779e35..36a85bbafc 100644 --- a/include/event2/tag.h +++ b/include/event2/tag.h @@ -38,10 +38,10 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif diff --git a/include/event2/thread.h b/include/event2/thread.h index 01d7f00bdf..e17ac025ef 100644 --- a/include/event2/thread.h +++ b/include/event2/thread.h @@ -69,7 +69,7 @@ extern "C" { #define EVTHREAD_TRY 0x10 /**@}*/ -#if !defined(_EVENT_DISABLE_THREAD_SUPPORT) || defined(_EVENT_IN_DOXYGEN) +#if !defined(EVENT__DISABLE_THREAD_SUPPORT) || defined(_EVENT_IN_DOXYGEN) #define EVTHREAD_LOCK_API_VERSION 1 @@ -187,7 +187,7 @@ int evthread_set_condition_callbacks( void evthread_set_id_callback( unsigned long (*id_fn)(void)); -#if (defined(_WIN32) && !defined(_EVENT_DISABLE_THREAD_SUPPORT)) || defined(_EVENT_IN_DOXYGEN) +#if (defined(_WIN32) && !defined(EVENT__DISABLE_THREAD_SUPPORT)) || defined(_EVENT_IN_DOXYGEN) /** Sets up Libevent for use with Windows builtin locking and thread ID functions. Unavailable if Libevent is not built for Windows. @@ -199,7 +199,7 @@ int evthread_use_windows_threads(void); #define EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED 1 #endif -#if defined(_EVENT_HAVE_PTHREADS) || defined(_EVENT_IN_DOXYGEN) +#if defined(EVENT__HAVE_PTHREADS) || defined(_EVENT_IN_DOXYGEN) /** Sets up Libevent for use with Pthreads locking and thread ID functions. Unavailable if Libevent is not build for use with pthreads. Requires libraries to link against Libevent_pthreads as well as Libevent. @@ -219,7 +219,7 @@ int evthread_use_pthreads(void); **/ void evthread_enable_lock_debuging(void); -#endif /* _EVENT_DISABLE_THREAD_SUPPORT */ +#endif /* EVENT__DISABLE_THREAD_SUPPORT */ struct event_base; /** Make sure it's safe to tell an event base to wake up from another thread diff --git a/include/event2/util.h b/include/event2/util.h index 2d1c5ca3ed..ad0398c6f0 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -38,25 +38,25 @@ extern "C" { #endif #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_STDINT_H +#ifdef EVENT__HAVE_STDINT_H #include -#elif defined(_EVENT_HAVE_INTTYPES_H) +#elif defined(EVENT__HAVE_INTTYPES_H) #include #endif -#ifdef _EVENT_HAVE_SYS_TYPES_H +#ifdef EVENT__HAVE_SYS_TYPES_H #include #endif -#ifdef _EVENT_HAVE_STDDEF_H +#ifdef EVENT__HAVE_STDDEF_H #include #endif #ifdef _MSC_VER #include #endif #include -#ifdef _EVENT_HAVE_NETDB_H +#ifdef EVENT__HAVE_NETDB_H #if !defined(_GNU_SOURCE) #define _GNU_SOURCE #endif @@ -70,8 +70,8 @@ extern "C" { #endif /* Some openbsd autoconf versions get the name of this macro wrong. */ -#if defined(_EVENT_SIZEOF_VOID__) && !defined(_EVENT_SIZEOF_VOID_P) -#define _EVENT_SIZEOF_VOID_P _EVENT_SIZEOF_VOID__ +#if defined(_EVENT_SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P) +#define EVENT__SIZEOF_VOID_P _EVENT_SIZEOF_VOID__ #endif /** @@ -103,16 +103,16 @@ extern "C" { * * @{ */ -#ifdef _EVENT_HAVE_UINT64_T +#ifdef EVENT__HAVE_UINT64_T #define ev_uint64_t uint64_t #define ev_int64_t int64_t #elif defined(_WIN32) #define ev_uint64_t unsigned __int64 #define ev_int64_t signed __int64 -#elif _EVENT_SIZEOF_LONG_LONG == 8 +#elif EVENT__SIZEOF_LONG_LONG == 8 #define ev_uint64_t unsigned long long #define ev_int64_t long long -#elif _EVENT_SIZEOF_LONG == 8 +#elif EVENT__SIZEOF_LONG == 8 #define ev_uint64_t unsigned long #define ev_int64_t long #elif defined(_EVENT_IN_DOXYGEN) @@ -122,16 +122,16 @@ extern "C" { #error "No way to define ev_uint64_t" #endif -#ifdef _EVENT_HAVE_UINT32_T +#ifdef EVENT__HAVE_UINT32_T #define ev_uint32_t uint32_t #define ev_int32_t int32_t #elif defined(_WIN32) #define ev_uint32_t unsigned int #define ev_int32_t signed int -#elif _EVENT_SIZEOF_LONG == 4 +#elif EVENT__SIZEOF_LONG == 4 #define ev_uint32_t unsigned long #define ev_int32_t signed long -#elif _EVENT_SIZEOF_INT == 4 +#elif EVENT__SIZEOF_INT == 4 #define ev_uint32_t unsigned int #define ev_int32_t signed int #elif defined(_EVENT_IN_DOXYGEN) @@ -141,16 +141,16 @@ extern "C" { #error "No way to define ev_uint32_t" #endif -#ifdef _EVENT_HAVE_UINT16_T +#ifdef EVENT__HAVE_UINT16_T #define ev_uint16_t uint16_t #define ev_int16_t int16_t #elif defined(_WIN32) #define ev_uint16_t unsigned short #define ev_int16_t signed short -#elif _EVENT_SIZEOF_INT == 2 +#elif EVENT__SIZEOF_INT == 2 #define ev_uint16_t unsigned int #define ev_int16_t signed int -#elif _EVENT_SIZEOF_SHORT == 2 +#elif EVENT__SIZEOF_SHORT == 2 #define ev_uint16_t unsigned short #define ev_int16_t signed short #elif defined(_EVENT_IN_DOXYGEN) @@ -160,7 +160,7 @@ extern "C" { #error "No way to define ev_uint16_t" #endif -#ifdef _EVENT_HAVE_UINT8_T +#ifdef EVENT__HAVE_UINT8_T #define ev_uint8_t uint8_t #define ev_int8_t int8_t #elif defined(_EVENT_IN_DOXYGEN) @@ -171,13 +171,13 @@ extern "C" { #define ev_int8_t signed char #endif -#ifdef _EVENT_HAVE_UINTPTR_T +#ifdef EVENT__HAVE_UINTPTR_T #define ev_uintptr_t uintptr_t #define ev_intptr_t intptr_t -#elif _EVENT_SIZEOF_VOID_P <= 4 +#elif EVENT__SIZEOF_VOID_P <= 4 #define ev_uintptr_t ev_uint32_t #define ev_intptr_t ev_int32_t -#elif _EVENT_SIZEOF_VOID_P <= 8 +#elif EVENT__SIZEOF_VOID_P <= 8 #define ev_uintptr_t ev_uint64_t #define ev_intptr_t ev_int64_t #elif defined(_EVENT_IN_DOXYGEN) @@ -187,8 +187,8 @@ extern "C" { #error "No way to define ev_uintptr_t" #endif -#ifdef _EVENT_ssize_t -#define ev_ssize_t _EVENT_ssize_t +#ifdef EVENT__ssize_t +#define ev_ssize_t EVENT__ssize_t #else #define ev_ssize_t ssize_t #endif @@ -202,9 +202,9 @@ extern "C" { */ #ifdef _WIN32 #define ev_off_t ev_int64_t -#elif _EVENT_SIZEOF_OFF_T == 8 +#elif EVENT__SIZEOF_OFF_T == 8 #define ev_off_t ev_int64_t -#elif _EVENT_SIZEOF_OFF_T == 4 +#elif EVENT__SIZEOF_OFF_T == 4 #define ev_off_t ev_int32_t #elif defined(_EVENT_IN_DOXYGEN) #define ev_off_t ... @@ -247,10 +247,10 @@ extern "C" { @{ */ -#if _EVENT_SIZEOF_SIZE_T == 8 +#if EVENT__SIZEOF_SIZE_T == 8 #define EV_SIZE_MAX EV_UINT64_MAX #define EV_SSIZE_MAX EV_INT64_MAX -#elif _EVENT_SIZEOF_SIZE_T == 4 +#elif EVENT__SIZEOF_SIZE_T == 4 #define EV_SIZE_MAX EV_UINT32_MAX #define EV_SSIZE_MAX EV_INT32_MAX #elif defined(_EVENT_IN_DOXYGEN) @@ -265,14 +265,14 @@ extern "C" { #ifdef _WIN32 #define ev_socklen_t int -#elif defined(_EVENT_socklen_t) -#define ev_socklen_t _EVENT_socklen_t +#elif defined(EVENT__socklen_t) +#define ev_socklen_t EVENT__socklen_t #else #define ev_socklen_t socklen_t #endif -#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY -#if !defined(_EVENT_HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \ +#ifdef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY +#if !defined(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \ && !defined(ss_family) #define ss_family __ss_family #endif @@ -400,7 +400,7 @@ const char *evutil_socket_error_to_string(int errcode); * * @{ */ -#ifdef _EVENT_HAVE_TIMERADD +#ifdef EVENT__HAVE_TIMERADD #define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp)) #define evutil_timersub(tvp, uvp, vvp) timersub((tvp), (uvp), (vvp)) #else @@ -424,7 +424,7 @@ const char *evutil_socket_error_to_string(int errcode); } while (0) #endif /* !_EVENT_HAVE_HAVE_TIMERADD */ -#ifdef _EVENT_HAVE_TIMERCLEAR +#ifdef EVENT__HAVE_TIMERCLEAR #define evutil_timerclear(tvp) timerclear(tvp) #else #define evutil_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 @@ -438,7 +438,7 @@ const char *evutil_socket_error_to_string(int errcode); ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) -#ifdef _EVENT_HAVE_TIMERISSET +#ifdef EVENT__HAVE_TIMERISSET #define evutil_timerisset(tvp) timerisset(tvp) #else #define evutil_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) @@ -456,7 +456,7 @@ const char *evutil_socket_error_to_string(int errcode); ev_int64_t evutil_strtoll(const char *s, char **endptr, int base); /** Replacement for gettimeofday on platforms that lack it. */ -#ifdef _EVENT_HAVE_GETTIMEOFDAY +#ifdef EVENT__HAVE_GETTIMEOFDAY #define evutil_gettimeofday(tv, tz) gettimeofday((tv), (tz)) #else struct timezone; @@ -523,7 +523,7 @@ int evutil_ascii_strncasecmp(const char *str1, const char *str2, size_t n); /* Here we define evutil_addrinfo to the native addrinfo type, or redefine it * if this system has no getaddrinfo(). */ -#ifdef _EVENT_HAVE_STRUCT_ADDRINFO +#ifdef EVENT__HAVE_STRUCT_ADDRINFO #define evutil_addrinfo addrinfo #else /** A definition of struct addrinfo for systems that lack it. @@ -549,32 +549,32 @@ struct evutil_addrinfo { @{ */ -#if defined(EAI_ADDRFAMILY) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_ADDRFAMILY) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_ADDRFAMILY EAI_ADDRFAMILY #else #define EVUTIL_EAI_ADDRFAMILY -901 #endif -#if defined(EAI_AGAIN) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_AGAIN) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_AGAIN EAI_AGAIN #else #define EVUTIL_EAI_AGAIN -902 #endif -#if defined(EAI_BADFLAGS) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_BADFLAGS) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_BADFLAGS EAI_BADFLAGS #else #define EVUTIL_EAI_BADFLAGS -903 #endif -#if defined(EAI_FAIL) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_FAIL) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_FAIL EAI_FAIL #else #define EVUTIL_EAI_FAIL -904 #endif -#if defined(EAI_FAMILY) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_FAMILY) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_FAMILY EAI_FAMILY #else #define EVUTIL_EAI_FAMILY -905 #endif -#if defined(EAI_MEMORY) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_MEMORY) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_MEMORY EAI_MEMORY #else #define EVUTIL_EAI_MEMORY -906 @@ -582,27 +582,27 @@ struct evutil_addrinfo { /* This test is a bit complicated, since some MS SDKs decide to * remove NODATA or redefine it to be the same as NONAME, in a * fun interpretation of RFC 2553 and RFC 3493. */ -#if defined(EAI_NODATA) && defined(_EVENT_HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME) +#if defined(EAI_NODATA) && defined(EVENT__HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME) #define EVUTIL_EAI_NODATA EAI_NODATA #else #define EVUTIL_EAI_NODATA -907 #endif -#if defined(EAI_NONAME) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_NONAME) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_NONAME EAI_NONAME #else #define EVUTIL_EAI_NONAME -908 #endif -#if defined(EAI_SERVICE) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_SERVICE) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_SERVICE EAI_SERVICE #else #define EVUTIL_EAI_SERVICE -909 #endif -#if defined(EAI_SOCKTYPE) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_SOCKTYPE) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_SOCKTYPE EAI_SOCKTYPE #else #define EVUTIL_EAI_SOCKTYPE -910 #endif -#if defined(EAI_SYSTEM) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(EAI_SYSTEM) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_EAI_SYSTEM EAI_SYSTEM #else #define EVUTIL_EAI_SYSTEM -911 @@ -610,37 +610,37 @@ struct evutil_addrinfo { #define EVUTIL_EAI_CANCEL -90001 -#if defined(AI_PASSIVE) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_PASSIVE) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_PASSIVE AI_PASSIVE #else #define EVUTIL_AI_PASSIVE 0x1000 #endif -#if defined(AI_CANONNAME) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_CANONNAME) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_CANONNAME AI_CANONNAME #else #define EVUTIL_AI_CANONNAME 0x2000 #endif -#if defined(AI_NUMERICHOST) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_NUMERICHOST) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_NUMERICHOST AI_NUMERICHOST #else #define EVUTIL_AI_NUMERICHOST 0x4000 #endif -#if defined(AI_NUMERICSERV) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_NUMERICSERV) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_NUMERICSERV AI_NUMERICSERV #else #define EVUTIL_AI_NUMERICSERV 0x8000 #endif -#if defined(AI_V4MAPPED) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_V4MAPPED) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_V4MAPPED AI_V4MAPPED #else #define EVUTIL_AI_V4MAPPED 0x10000 #endif -#if defined(AI_ALL) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_ALL) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_ALL AI_ALL #else #define EVUTIL_AI_ALL 0x20000 #endif -#if defined(AI_ADDRCONFIG) && defined(_EVENT_HAVE_GETADDRINFO) +#if defined(AI_ADDRCONFIG) && defined(EVENT__HAVE_GETADDRINFO) #define EVUTIL_AI_ADDRCONFIG AI_ADDRCONFIG #else #define EVUTIL_AI_ADDRCONFIG 0x40000 diff --git a/ipv6-internal.h b/ipv6-internal.h index e0d4109b71..7444b0ff2b 100644 --- a/ipv6-internal.h +++ b/ipv6-internal.h @@ -34,7 +34,7 @@ #include "evconfig-private.h" #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include "event2/util.h" @@ -49,17 +49,17 @@ extern "C" { * properly. */ -#ifndef _EVENT_HAVE_STRUCT_IN6_ADDR +#ifndef EVENT__HAVE_STRUCT_IN6_ADDR struct in6_addr { ev_uint8_t s6_addr[16]; }; #endif -#ifndef _EVENT_HAVE_SA_FAMILY_T +#ifndef EVENT__HAVE_SA_FAMILY_T typedef int sa_family_t; #endif -#ifndef _EVENT_HAVE_STRUCT_SOCKADDR_IN6 +#ifndef EVENT__HAVE_STRUCT_SOCKADDR_IN6 struct sockaddr_in6 { /* This will fail if we find a struct sockaddr that doesn't have * sa_family as the first element. */ diff --git a/kqueue.c b/kqueue.c index b688599c6f..9a2aa16d1f 100644 --- a/kqueue.c +++ b/kqueue.c @@ -29,10 +29,10 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_KQUEUE +#ifdef EVENT__HAVE_KQUEUE #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -43,14 +43,14 @@ #include #include #include -#ifdef _EVENT_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(_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__) #define PTR_TO_UDATA(x) ((intptr_t)(x)) #define INT_TO_UDATA(x) ((intptr_t)(x)) #else @@ -473,4 +473,4 @@ kq_sig_del(struct event_base *base, int nsignal, short old, short events, void * return (0); } -#endif /* _EVENT_HAVE_KQUEUE */ +#endif /* EVENT__HAVE_KQUEUE */ diff --git a/listener.c b/listener.c index 4724ca1f3f..acd7db0968 100644 --- a/listener.c +++ b/listener.c @@ -39,13 +39,13 @@ #include #endif #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif -#ifdef _EVENT_HAVE_FCNTL_H +#ifdef EVENT__HAVE_FCNTL_H #include #endif -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif diff --git a/log-internal.h b/log-internal.h index 4e0fede0ec..47064e225e 100644 --- a/log-internal.h +++ b/log-internal.h @@ -41,7 +41,7 @@ #define USE_GLOBAL_FOR_DEBUG_LOGGING -#if !defined(_EVENT_DISABLE_DEBUG_MODE) || defined(USE_DEBUG) +#if !defined(EVENT__DISABLE_DEBUG_MODE) || defined(USE_DEBUG) #define EVENT_DEBUG_LOGGING_ENABLED #endif diff --git a/mm-internal.h b/mm-internal.h index 96d9e9ba73..ff6d475826 100644 --- a/mm-internal.h +++ b/mm-internal.h @@ -32,7 +32,7 @@ extern "C" { #endif -#ifndef _EVENT_DISABLE_MM_REPLACEMENT +#ifndef EVENT__DISABLE_MM_REPLACEMENT /* Internal use only: Memory allocation functions. We give them nice short * mm_names for our own use, but make sure that the symbols have longer names * so they don't conflict with other libraries (like, say, libmm). */ diff --git a/poll.c b/poll.c index 98b73776d3..cde8bd7302 100644 --- a/poll.c +++ b/poll.c @@ -29,10 +29,10 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_POLL +#ifdef EVENT__HAVE_POLL #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -130,7 +130,7 @@ poll_dispatch(struct event_base *base, struct timeval *tv) nfds = pop->nfds; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (base->th_base_lock) { /* If we're using this backend in a multithreaded setting, * then we need to work on a copy of event_set, so that we can @@ -335,4 +335,4 @@ poll_dealloc(struct event_base *base) mm_free(pop); } -#endif /* _EVENT_HAVE_POLL */ +#endif /* EVENT__HAVE_POLL */ diff --git a/sample/dns-example.c b/sample/dns-example.c index 6ba1359ad6..cb8d32ff58 100644 --- a/sample/dns-example.c +++ b/sample/dns-example.c @@ -26,7 +26,7 @@ #include #include -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif diff --git a/sample/http-server.c b/sample/http-server.c index 2d04fd30a3..a02a66f4cb 100644 --- a/sample/http-server.c +++ b/sample/http-server.c @@ -40,7 +40,7 @@ #include #include -#ifdef _EVENT_HAVE_NETINET_IN_H +#ifdef EVENT__HAVE_NETINET_IN_H #include # ifdef _XOPEN_SOURCE_EXTENDED # include diff --git a/sample/signal-test.c b/sample/signal-test.c index 3772e2b7ed..50cc430163 100644 --- a/sample/signal-test.c +++ b/sample/signal-test.c @@ -26,8 +26,8 @@ #include -#ifdef _EVENT___func__ -#define __func__ _EVENT___func__ +#ifdef EVENT____func__ +#define __func__ EVENT____func__ #endif int called = 0; diff --git a/sample/time-test.c b/sample/time-test.c index ddbc029a8a..8d5e869b9b 100644 --- a/sample/time-test.c +++ b/sample/time-test.c @@ -18,7 +18,7 @@ #include #endif #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include diff --git a/select.c b/select.c index f176c848f8..8ff066135e 100644 --- a/select.c +++ b/select.c @@ -29,7 +29,7 @@ #include "event2/event-config.h" #include "evconfig-private.h" -#ifdef _EVENT_HAVE_SELECT +#ifdef EVENT__HAVE_SELECT #ifdef __APPLE__ /* Apple wants us to define this if we might ever pass more than @@ -38,10 +38,10 @@ #endif #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_SELECT_H +#ifdef EVENT__HAVE_SYS_SELECT_H #include #endif #include @@ -59,7 +59,7 @@ #include "log-internal.h" #include "evmap-internal.h" -#ifndef _EVENT_HAVE_FD_MASK +#ifndef EVENT__HAVE_FD_MASK /* This type is mandatory, but Android doesn't define it. */ typedef unsigned long fd_mask; #endif @@ -341,4 +341,4 @@ select_dealloc(struct event_base *base) select_free_selectop(base->evbase); } -#endif /* _EVENT_HAVE_SELECT */ +#endif /* EVENT__HAVE_SELECT */ diff --git a/signal.c b/signal.c index e279f5e81d..a34f5a45ee 100644 --- a/signal.c +++ b/signal.c @@ -36,22 +36,22 @@ #undef WIN32_LEAN_AND_MEAN #endif #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include #include #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include -#ifdef _EVENT_HAVE_FCNTL_H +#ifdef EVENT__HAVE_FCNTL_H #include #endif @@ -101,7 +101,7 @@ static const struct eventop evsigops = { 0, 0, 0 }; -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT /* Lock for evsig_base and evsig_base_n_signals_added fields. */ static void *evsig_base_lock = NULL; #endif @@ -212,7 +212,7 @@ int _evsig_set_handler(struct event_base *base, int evsignal, void (__cdecl *handler)(int)) { -#ifdef _EVENT_HAVE_SIGACTION +#ifdef EVENT__HAVE_SIGACTION struct sigaction sa; #else ev_sighandler_t sh; @@ -249,7 +249,7 @@ _evsig_set_handler(struct event_base *base, } /* save previous handler and setup new handler */ -#ifdef _EVENT_HAVE_SIGACTION +#ifdef EVENT__HAVE_SIGACTION memset(&sa, 0, sizeof(sa)); sa.sa_handler = handler; sa.sa_flags |= SA_RESTART; @@ -325,7 +325,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal) { int ret = 0; struct evsig_info *sig = &base->sig; -#ifdef _EVENT_HAVE_SIGACTION +#ifdef EVENT__HAVE_SIGACTION struct sigaction *sh; #else ev_sighandler_t *sh; @@ -340,7 +340,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal) /* restore previous handler */ sh = sig->sh_old[evsignal]; sig->sh_old[evsignal] = NULL; -#ifdef _EVENT_HAVE_SIGACTION +#ifdef EVENT__HAVE_SIGACTION if (sigaction(evsignal, sh, NULL) == -1) { event_warn("sigaction"); ret = -1; @@ -388,7 +388,7 @@ evsig_handler(int sig) return; } -#ifndef _EVENT_HAVE_SIGACTION +#ifndef EVENT__HAVE_SIGACTION signal(sig, evsig_handler); #endif @@ -449,7 +449,7 @@ evsig_dealloc(struct event_base *base) } } -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT int evsig_global_setup_locks_(const int enable_locks) { diff --git a/strlcpy-internal.h b/strlcpy-internal.h index 4152b7bd01..5fb2fff14d 100644 --- a/strlcpy-internal.h +++ b/strlcpy-internal.h @@ -8,7 +8,7 @@ extern "C" { #include "event2/event-config.h" #include "evconfig-private.h" -#ifndef _EVENT_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 3656e9f064..5f5627d0e0 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -36,7 +36,7 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp #include -#ifndef _EVENT_HAVE_STRLCPY +#ifndef EVENT__HAVE_STRLCPY #include "strlcpy-internal.h" /* diff --git a/test/bench.c b/test/bench.c index 77ca8b5348..7686c71c73 100644 --- a/test/bench.c +++ b/test/bench.c @@ -37,7 +37,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #ifdef _WIN32 @@ -52,7 +52,7 @@ #include #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include diff --git a/test/bench_cascade.c b/test/bench_cascade.c index dc42f287b5..e929322858 100644 --- a/test/bench_cascade.c +++ b/test/bench_cascade.c @@ -29,7 +29,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #ifdef _WIN32 @@ -44,7 +44,7 @@ #include #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include diff --git a/test/regress.c b/test/regress.c index 9c77967275..410a714f88 100644 --- a/test/regress.c +++ b/test/regress.c @@ -35,7 +35,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -1102,12 +1102,12 @@ test_signal_restore(void) { struct event ev; struct event_base *base = event_init(); -#ifdef _EVENT_HAVE_SIGACTION +#ifdef EVENT__HAVE_SIGACTION struct sigaction sa; #endif test_ok = 0; -#ifdef _EVENT_HAVE_SIGACTION +#ifdef EVENT__HAVE_SIGACTION sa.sa_handler = signal_cb_sa; sa.sa_flags = 0x0; sigemptyset(&sa.sa_mask); @@ -1888,9 +1888,9 @@ test_base_features(void *arg) event_config_free(cfg); } -#ifdef _EVENT_HAVE_SETENV +#ifdef EVENT__HAVE_SETENV #define SETENV_OK -#elif !defined(_EVENT_HAVE_SETENV) && defined(_EVENT_HAVE_PUTENV) +#elif !defined(EVENT__HAVE_SETENV) && defined(EVENT__HAVE_PUTENV) static void setenv(const char *k, const char *v, int _o) { char b[256]; @@ -1900,9 +1900,9 @@ static void setenv(const char *k, const char *v, int _o) #define SETENV_OK #endif -#ifdef _EVENT_HAVE_UNSETENV +#ifdef EVENT__HAVE_UNSETENV #define UNSETENV_OK -#elif !defined(_EVENT_HAVE_UNSETENV) && defined(_EVENT_HAVE_PUTENV) +#elif !defined(EVENT__HAVE_UNSETENV) && defined(EVENT__HAVE_PUTENV) static void unsetenv(const char *k) { char b[256]; @@ -1940,7 +1940,7 @@ test_base_environ(void *arg) setenv("EVENT_NOWAFFLES", "1", 1); unsetenv("EVENT_NOWAFFLES"); if (getenv("EVENT_NOWAFFLES") != NULL) { -#ifndef _EVENT_HAVE_UNSETENV +#ifndef EVENT__HAVE_UNSETENV TT_DECLARE("NOTE", ("Can't fake unsetenv; skipping test")); #else TT_DECLARE("NOTE", ("unsetenv doesn't work; skipping test")); @@ -2187,7 +2187,7 @@ test_dup_fd(void *arg) } #endif -#ifdef _EVENT_DISABLE_MM_REPLACEMENT +#ifdef EVENT__DISABLE_MM_REPLACEMENT static void test_mm_functions(void *arg) { diff --git a/test/regress_buffer.c b/test/regress_buffer.c index b22f083ae2..9546b804dd 100644 --- a/test/regress_buffer.c +++ b/test/regress_buffer.c @@ -35,7 +35,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -800,7 +800,7 @@ test_evbuffer_add_file(void *ptr) /* Say that it drains to a fd so that we can use sendfile. */ evbuffer_set_flags(src, EVBUFFER_FLAG_DRAINS_TO_FD); -#if defined(_EVENT_HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__) +#if defined(EVENT__HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__) /* We need to use a pair of AF_INET sockets, since Solaris doesn't support sendfile() over AF_UNIX. */ if (evutil_ersatz_socketpair(AF_INET, SOCK_STREAM, 0, pair) == -1) @@ -867,7 +867,7 @@ test_evbuffer_add_file(void *ptr) } } -#ifndef _EVENT_DISABLE_MM_REPLACEMENT +#ifndef EVENT__DISABLE_MM_REPLACEMENT static void * failing_malloc(size_t how_much) { @@ -1098,7 +1098,7 @@ test_evbuffer_readln(void *ptr) evbuffer_validate(evb); /* the next call to readline should fail */ -#ifndef _EVENT_DISABLE_MM_REPLACEMENT +#ifndef EVENT__DISABLE_MM_REPLACEMENT event_set_mem_functions(failing_malloc, realloc, free); cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); tt_assert(cp == NULL); diff --git a/test/regress_bufferevent.c b/test/regress_bufferevent.c index fad1a210ff..be8dc7d69b 100644 --- a/test/regress_bufferevent.c +++ b/test/regress_bufferevent.c @@ -38,7 +38,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -58,7 +58,7 @@ #include #include -#ifdef _EVENT_HAVE_ARPA_INET_H +#ifdef EVENT__HAVE_ARPA_INET_H #include #endif @@ -814,7 +814,7 @@ struct testcase_t bufferevent_testcases[] = { TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"filter" }, { "bufferevent_timeout_filter_pair", test_bufferevent_timeouts, TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"filter pair" }, -#ifdef _EVENT_HAVE_LIBZ +#ifdef EVENT__HAVE_LIBZ LEGACY(bufferevent_zlib, TT_ISOLATED), #else { "bufferevent_zlib", NULL, TT_SKIP, NULL, NULL }, diff --git a/test/regress_dns.c b/test/regress_dns.c index 69f61ec1f9..ae1fc30a3f 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -36,7 +36,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -47,7 +47,7 @@ #include #include #endif -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif #ifdef HAVE_NETDB_H @@ -98,7 +98,7 @@ dns_gethostbyname_cb(int result, char type, int count, int ttl, switch (type) { case DNS_IPv6_AAAA: { -#if defined(_EVENT_HAVE_STRUCT_IN6_ADDR) && defined(_EVENT_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; @@ -319,7 +319,7 @@ dns_server_gethostbyname_cb(int result, char type, int count, int ttl, break; } case DNS_IPv6_AAAA: { -#if defined (_EVENT_HAVE_STRUCT_IN6_ADDR) && defined(_EVENT_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) @@ -1711,7 +1711,7 @@ testleak_cleanup(const struct testcase_t *testcase, void *env_) { int ok = 0; struct testleak_env_t *env = env_; -#ifdef _EVENT_DISABLE_DEBUG_MODE +#ifdef EVENT__DISABLE_DEBUG_MODE tt_int_op(allocated_chunks, ==, 0); #else /* FIXME: that's `1' because of event_debug_map_HT_GROW */ diff --git a/test/regress_et.c b/test/regress_et.c index ca5d9b572e..7bc36781d0 100644 --- a/test/regress_et.c +++ b/test/regress_et.c @@ -31,7 +31,7 @@ #endif #include #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include @@ -162,7 +162,7 @@ test_edgetriggered_mix_error(void *data_) struct event_base *base = NULL; struct event *ev_et=NULL, *ev_lt=NULL; -#ifdef _EVENT_DISABLE_DEBUG_MODE +#ifdef EVENT__DISABLE_DEBUG_MODE if (1) tt_skip(); #endif diff --git a/test/regress_http.c b/test/regress_http.c index da34f099ea..14c271b6e6 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -36,7 +36,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include diff --git a/test/regress_main.c b/test/regress_main.c index 23a8cd11c4..58dd246d0f 100644 --- a/test/regress_main.c +++ b/test/regress_main.c @@ -35,14 +35,14 @@ #include "event2/event-config.h" -#ifdef _EVENT___func__ -#define __func__ _EVENT___func__ +#ifdef EVENT____func__ +#define __func__ EVENT____func__ #endif #if 0 #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -331,7 +331,7 @@ const struct testcase_setup_t legacy_setup = { /* ============================================================ */ -#if (!defined(_EVENT_HAVE_PTHREADS) && !defined(_WIN32)) || defined(_EVENT_DISABLE_THREAD_SUPPORT) +#if (!defined(EVENT__HAVE_PTHREADS) && !defined(_WIN32)) || defined(EVENT__DISABLE_THREAD_SUPPORT) struct testcase_t thread_testcases[] = { { "basic", NULL, TT_SKIP, NULL, NULL }, END_OF_TESTCASES @@ -357,7 +357,7 @@ struct testgroup_t testgroups[] = { { "iocp/bufferevent/", bufferevent_iocp_testcases }, { "iocp/listener/", listener_iocp_testcases }, #endif -#ifdef _EVENT_HAVE_OPENSSL +#ifdef EVENT__HAVE_OPENSSL { "ssl/", ssl_testcases }, #endif END_OF_GROUPS @@ -385,7 +385,7 @@ main(int argc, const char **argv) tinytest_skip(testgroups, "http/connection_retry"); #endif -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (!getenv("EVENT_NO_DEBUG_LOCKS")) evthread_enable_lock_debuging(); #endif diff --git a/test/regress_rpc.c b/test/regress_rpc.c index 71ff1b50c2..771f3acc15 100644 --- a/test/regress_rpc.c +++ b/test/regress_rpc.c @@ -37,7 +37,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include diff --git a/test/regress_testutils.c b/test/regress_testutils.c index e74f212d54..e612c52fae 100644 --- a/test/regress_testutils.c +++ b/test/regress_testutils.c @@ -35,7 +35,7 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif #include @@ -46,7 +46,7 @@ #include #include #endif -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif #ifdef HAVE_NETDB_H diff --git a/test/regress_thread.c b/test/regress_thread.c index 2cd5948fc6..20677194fb 100644 --- a/test/regress_thread.c +++ b/test/regress_thread.c @@ -34,20 +34,20 @@ #include #include #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif -#ifdef _EVENT_HAVE_SYS_WAIT_H +#ifdef EVENT__HAVE_SYS_WAIT_H #include #endif -#ifdef _EVENT_HAVE_PTHREADS +#ifdef EVENT__HAVE_PTHREADS #include #elif defined(_WIN32) #include #endif #include -#ifdef _EVENT_HAVE_UNISTD_H +#ifdef EVENT__HAVE_UNISTD_H #include #endif #include @@ -64,7 +64,7 @@ #include "regress.h" #include "tinytest_macros.h" -#ifdef _EVENT_HAVE_PTHREADS +#ifdef EVENT__HAVE_PTHREADS #define THREAD_T pthread_t #define THREAD_FN void * #define THREAD_RETURN() return (NULL) diff --git a/test/regress_util.c b/test/regress_util.c index 92c2e442d6..538d8064e2 100644 --- a/test/regress_util.c +++ b/test/regress_util.c @@ -41,10 +41,10 @@ #include #include #endif -#ifdef _EVENT_HAVE_NETINET_IN6_H +#ifdef EVENT__HAVE_NETINET_IN6_H #include #endif -#ifdef _EVENT_HAVE_SYS_WAIT_H +#ifdef EVENT__HAVE_SYS_WAIT_H #include #endif #include @@ -247,7 +247,7 @@ regress_sockaddr_port_parse(void *ptr) if (ent->safamily == AF_INET) { struct sockaddr_in sin; memset(&sin, 0, sizeof(sin)); -#ifdef _EVENT_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; @@ -263,7 +263,7 @@ regress_sockaddr_port_parse(void *ptr) } else { struct sockaddr_in6 sin6; memset(&sin6, 0, sizeof(sin6)); -#ifdef _EVENT_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/test-changelist.c b/test/test-changelist.c index 658057dedb..16622a4066 100644 --- a/test/test-changelist.c +++ b/test/test-changelist.c @@ -34,11 +34,11 @@ #endif #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include diff --git a/test/test-eof.c b/test/test-eof.c index e3cb4603ae..cad674603a 100644 --- a/test/test-eof.c +++ b/test/test-eof.c @@ -33,10 +33,10 @@ #endif #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include @@ -48,8 +48,8 @@ #include #include -#ifdef _EVENT___func__ -#define __func__ _EVENT___func__ +#ifdef EVENT____func__ +#define __func__ EVENT____func__ #endif int test_okay = 1; diff --git a/test/test-fdleak.c b/test/test-fdleak.c index 544c3d8150..030a3f5293 100644 --- a/test/test-fdleak.c +++ b/test/test-fdleak.c @@ -33,10 +33,10 @@ #include #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_RESOURCE_H +#ifdef EVENT__HAVE_SYS_RESOURCE_H #include #endif @@ -212,7 +212,7 @@ start_client(struct event_base *base) int main(int argc, char **argv) { -#ifdef _EVENT_HAVE_SETRLIMIT +#ifdef EVENT__HAVE_SETRLIMIT /* Set the fd limit to a low value so that any fd leak is caught without making many requests. */ struct rlimit rl; diff --git a/test/test-init.c b/test/test-init.c index 1a26b4e188..3d28f0b1c8 100644 --- a/test/test-init.c +++ b/test/test-init.c @@ -28,10 +28,10 @@ #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include diff --git a/test/test-ratelim.c b/test/test-ratelim.c index 1aabc45854..2b40469e73 100644 --- a/test/test-ratelim.c +++ b/test/test-ratelim.c @@ -470,7 +470,7 @@ main(int argc, char **argv) #endif } -#ifndef _EVENT_DISABLE_THREAD_SUPPORT +#ifndef EVENT__DISABLE_THREAD_SUPPORT evthread_enable_lock_debuging(); #endif diff --git a/test/test-weof.c b/test/test-weof.c index 06d67d164d..7df0e9c94c 100644 --- a/test/test-weof.c +++ b/test/test-weof.c @@ -33,10 +33,10 @@ #endif #include #include -#ifdef _EVENT_HAVE_SYS_TIME_H +#ifdef EVENT__HAVE_SYS_TIME_H #include #endif -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif #include @@ -51,8 +51,8 @@ #include "event2/event_compat.h" #include "event2/util.h" -#ifdef _EVENT___func__ -#define __func__ _EVENT___func__ +#ifdef EVENT____func__ +#define __func__ EVENT____func__ #endif evutil_socket_t pair[2]; diff --git a/util-internal.h b/util-internal.h index afa908c680..52de23dd48 100644 --- a/util-internal.h +++ b/util-internal.h @@ -35,10 +35,10 @@ #include "log-internal.h" #include #include -#ifdef _EVENT_HAVE_SYS_SOCKET_H +#ifdef EVENT__HAVE_SYS_SOCKET_H #include #endif -#ifdef _EVENT_HAVE_SYS_EVENTFD_H +#ifdef EVENT__HAVE_SYS_EVENTFD_H #include #endif #include "event2/util.h" @@ -50,11 +50,11 @@ extern "C" { #endif /* If we need magic to say "inline", get it for free internally. */ -#ifdef _EVENT_inline -#define inline _EVENT_inline +#ifdef EVENT__inline +#define inline EVENT__inline #endif -#ifdef _EVENT___func__ -#define __func__ _EVENT___func__ +#ifdef EVENT____func__ +#define __func__ EVENT____func__ #endif /* A good no-op to use in macro definitions. */ @@ -286,7 +286,7 @@ long _evutil_weakrand(void); #define EVUTIL_FAILURE_CHECK(cond) EVUTIL_UNLIKELY(cond) #endif -#ifndef _EVENT_HAVE_STRUCT_SOCKADDR_STORAGE +#ifndef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE /* Replacement for sockaddr storage that we can use internally on platforms * that lack it. It is not space-efficient, but neither is sockaddr_storage. */ @@ -375,7 +375,7 @@ HANDLE evutil_load_windows_system_library(const TCHAR *library_name); #endif #ifndef EV_SIZE_FMT -#if (_EVENT_SIZEOF_SIZE_T <= _EVENT_SIZEOF_LONG) +#if (EVENT__SIZEOF_SIZE_T <= EVENT__SIZEOF_LONG) #define EV_SIZE_FMT "%lu" #define EV_SSIZE_FMT "%ld" #define EV_SIZE_ARG(x) ((unsigned long)(x))