Compilation fixes for vc++ 2008 express. Not the end of them.

svn:r1260
This commit is contained in:
Nick Mathewson 2009-04-30 23:49:15 +00:00
parent 7f9678079f
commit ebf294559e
6 changed files with 142 additions and 45 deletions

View File

@ -1,6 +1,10 @@
/* event-config.h
* Generated by autoconf; post-processed by libevent.
* Do not edit this file.
*
* This file was generated by autoconf when libevent was built, and post-
* processed by Libevent so that its macros would have a uniform prefix.
*
* DO NOT EDIT THIS FILE.
*
* Do not rely on macros in this file existing in later versions.
*/
#ifndef _EVENT_CONFIG_H_
@ -8,12 +12,21 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if libevent should not allow replacing the mm functions */
/* #undef _EVENT_DISABLE_MM_REPLACEMENT */
/* Define if libevent should not be compiled with thread support */
/* #undef _EVENT_DISABLE_THREAD_SUPPORT */
/* Define if clock_gettime is available in libc */
/* #undef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID */
/* Define is no secure id variant is available */
#define _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID 1
/* Define to 1 if you have the <arpa/inet.h> header file. */
/* #undef _EVENT_HAVE_ARPA_INET_H */
/* Define to 1 if you have the `clock_gettime' function. */
/* #undef _EVENT_HAVE_CLOCK_GETTIME */
@ -29,6 +42,9 @@
/* Define to 1 if you have the `epoll_ctl' function. */
/* #undef _EVENT_HAVE_EPOLL_CTL */
/* Define to 1 if you have the `eventfd' function. */
/* #undef _EVENT_HAVE_EVENTFD */
/* Define if your system supports event ports */
/* #undef _EVENT_HAVE_EVENT_PORTS */
@ -47,33 +63,39 @@
/* Define to 1 if you have the `gettimeofday' function. */
/* #define _EVENT_HAVE_GETTIMEOFDAY 1 */
/* Define to 1 if you have the `inet_aton' function. */
/* #undef _EVENT_HAVE_INET_ATON */
/* Define to 1 if you have the `inet_ntop' function. */
/* #undef _EVENT_HAVE_INET_NTOP */
/* Define to 1 if you have the `inet_pton' function. */
/* #undef _EVENT_HAVE_INET_PTON */
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef _EVENT_HAVE_INTTYPES_H 1 */
/* #define _EVENT_HAVE_INTTYPES_H 1 */
/* Define to 1 if you have the `kqueue' function. */
/* #undef _EVENT_HAVE_KQUEUE */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef _EVENT_HAVE_LIBNSL */
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef _EVENT_HAVE_LIBRESOLV */
/* Define to 1 if you have the `rt' library (-lrt). */
/* #undef _EVENT_HAVE_LIBRT */
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef _EVENT_HAVE_LIBSOCKET */
/* Define if the system has zlib */
/* #undef _EVENT_HAVE_LIBZ */
/* Define to 1 if you have the <memory.h> header file. */
#define _EVENT_HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
/* #undef _EVENT_HAVE_MMAP */
/* Define to 1 if you have the <netinet/in6.h> header file. */
/* #undef _EVENT_HAVE_NETINET_IN6_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef _EVENT_HAVE_NETINET_IN_H */
/* Define to 1 if you have the `pipe' function. */
/* #undef _EVENT_HAVE_PIPE */
/* Define to 1 if you have the `poll' function. */
/* #undef _EVENT_HAVE_POLL */
@ -86,9 +108,21 @@
/* Define to 1 if you have the <port.h> header file. */
/* #undef _EVENT_HAVE_PORT_H */
/* Define if you have POSIX threads libraries and header files. */
/* #undef _EVENT_HAVE_PTHREAD */
/* Define if we have pthreads on this system */
/* #undef _EVENT_HAVE_PTHREADS */
/* Define to 1 if the system has the type `sa_family_t'. */
/* #undef _EVENT_HAVE_SA_FAMILY_T */
/* Define to 1 if you have the `select' function. */
/* #undef _EVENT_HAVE_SELECT */
/* Define to 1 if you have the `sendfile' function. */
/* #undef _EVENT_HAVE_SENDFILE */
/* Define if F_SETFD is defined in <fcntl.h> */
/* #undef _EVENT_HAVE_SETFD */
@ -98,12 +132,15 @@
/* Define to 1 if you have the `signal' function. */
#define _EVENT_HAVE_SIGNAL 1
/* Define to 1 if you have the <signal.h> header file. */
#define _EVENT_HAVE_SIGNAL_H 1
/* Define to 1 if you have the `splice' function. */
/* #undef _EVENT_HAVE_SPLICE */
/* Define to 1 if you have the <stdarg.h> header file. */
#define _EVENT_HAVE_STDARG_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#define _EVENT_HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
/* #define _EVENT_HAVE_STDINT_H 1 */
@ -125,27 +162,57 @@
/* Define to 1 if you have the `strtok_r' function. */
/* #undef _EVENT_HAVE_STRTOK_R */
/* Define to 1 if you have the `strtoll' function. */
/* #define _EVENT_HAVE_STRTOLL 1 */
/* Define to 1 if the system has the type `struct in6_addr'. */
#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 to 1 if `s6_addr32' is member of `struct in6_addr'. */
#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 to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
/* #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 */
/* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/epoll.h> header file. */
/* #undef _EVENT_HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/eventfd.h> header file. */
/* #undef _EVENT_HAVE_SYS_EVENTFD_H */
/* Define to 1 if you have the <sys/event.h> header file. */
/* #undef _EVENT_HAVE_SYS_EVENT_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
/* #undef _EVENT_HAVE_SYS_IOCTL_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef _EVENT_HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define _EVENT_HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/queue.h> header file. */
/* #undef _EVENT_HAVE_SYS_QUEUE_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef _EVENT_HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/sendfile.h> header file. */
/* #undef _EVENT_HAVE_SYS_SENDFILE_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef _EVENT_HAVE_SYS_SOCKET_H */
@ -156,7 +223,10 @@
/* #define _EVENT_HAVE_SYS_TIME_H 1 */
/* Define to 1 if you have the <sys/types.h> header file. */
/* #define _EVENT_HAVE_SYS_TYPES_H 1 */
#define _EVENT_HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
/* #undef _EVENT_HAVE_SYS_UIO_H */
/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
/* #undef _EVENT_HAVE_TAILQFOREACH */
@ -165,7 +235,7 @@
/* #undef _EVENT_HAVE_TIMERADD */
/* Define if timerclear is defined in <sys/time.h> */
/* #define _EVENT_HAVE_TIMERCLEAR 1 */
#define _EVENT_HAVE_TIMERCLEAR 1
/* Define if timercmp is defined in <sys/time.h> */
#define _EVENT_HAVE_TIMERCMP 1
@ -173,6 +243,18 @@
/* Define if timerisset is defined in <sys/time.h> */
#define _EVENT_HAVE_TIMERISSET 1
/* Define to 1 if the system has the type `uint16_t'. */
/* #define _EVENT_HAVE_UINT16_T 1 */
/* Define to 1 if the system has the type `uint32_t'. */
/* #define _EVENT_HAVE_UINT32_T 1 */
/* Define to 1 if the system has the type `uint64_t'. */
/* #define _EVENT_HAVE_UINT64_T 1 */
/* Define to 1 if the system has the type `uint8_t'. */
/* #define _EVENT_HAVE_UINT8_T 1 */
/* Define to 1 if you have the <unistd.h> header file. */
/* #define _EVENT_HAVE_UNISTD_H 1 */
@ -182,6 +264,9 @@
/* Define if kqueue works correctly with pipes */
/* #undef _EVENT_HAVE_WORKING_KQUEUE */
/* Numeric representation of the version */
#define _EVENT_NUMERIC_VERSION 0x02000101
/* Name of package */
#define _EVENT_PACKAGE "libevent"
@ -200,6 +285,22 @@
/* Define to the version of this package. */
#define _EVENT_PACKAGE_VERSION ""
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef _EVENT_PTHREAD_CREATE_JOINABLE */
/* The size of a `int', as computed by sizeof. */
#define _EVENT_SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
#define _EVENT_SIZEOF_LONG 4
/* The size of a `long long', as computed by sizeof. */
#define _EVENT_SIZEOF_LONG_LONG 8
/* The size of a `short', as computed by sizeof. */
#define _EVENT_SIZEOF_SHORT 2
/* Define to 1 if you have the ANSI C header files. */
#define _EVENT_STDC_HEADERS 1
@ -207,10 +308,10 @@
#define _EVENT_TIME_WITH_SYS_TIME 1
/* Version number of package */
#define _EVENT_VERSION "1.3.99-trunk"
#define _EVENT_VERSION "2.0.1-alpha-dev"
/* Define to appropriate substitue if compiler doesnt have __func__ */
/* #undef _EVENT___func__ */
#define _EVENT___func__ __FUNCTION__
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef _EVENT_const */
@ -230,15 +331,4 @@
/* Define to unsigned int if you dont have it */
#define _EVENT_socklen_t unsigned int
/* Define to `unsigned short' if <sys/types.h> does not define. */
/* #undef _EVENT_uint16_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef _EVENT_uint32_t */
/* Define to `unsigned long long' if <sys/types.h> does not define. */
/* #undef _EVENT_uint64_t */
/* Define to `unsigned char' if <sys/types.h> does not define. */
/* #undef _EVENT_uint8_t */
#endif

View File

@ -25,12 +25,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef _MSC_VER
#include "./config.h"
#else
/* Avoid the windows/msvc thing. */
#include "../config.h"
#endif
#include <winsock2.h>
#include <windows.h>
@ -43,8 +37,11 @@
#include <errno.h>
#include <assert.h>
#include "event2/util.h"
#include "event-config.h"
#include "util-internal.h"
#include "log-internal.h"
#include "event.h"
#include "event2/event.h"
#include "event-internal.h"
#include "evmap-internal.h"
@ -280,7 +277,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
{
struct win32op *win32op = base->evbase;
int res = 0;
int i;
unsigned i;
int fd_count;
fd_set_copy(win32op->readset_out, win32op->readset_in);

View File

@ -469,7 +469,7 @@ event_get_supported_methods(void)
tmp[i] = NULL;
if (methods != NULL)
mm_free(methods);
mm_free((char**)methods);
methods = tmp;

View File

@ -388,7 +388,7 @@ evutil_inet_ntop(int af, const void *src, char *dst, size_t len)
(int)(ev_uint8_t)((a>>16)&0xff),
(int)(ev_uint8_t)((a>>8 )&0xff),
(int)(ev_uint8_t)((a )&0xff));
if (r<0||r>=len)
if (r<0||(size_t)r>=len)
return NULL;
else
return dst;
@ -490,7 +490,7 @@ evutil_inet_pton(int af, const char *src, void *dst)
#ifdef AF_INET6
} else if (af == AF_INET6) {
struct in6_addr *out = dst;
uint16_t words[8];
ev_uint16_t words[8];
int gapPos = -1, i, setWords=0;
const char *dot = strchr(src, '.');
const char *eow; /* end of words. */
@ -536,7 +536,7 @@ evutil_inet_pton(int af, const char *src, void *dst)
if (r<0 || r>65536)
return 0;
words[i++] = (uint16_t)r;
words[i++] = (ev_uint16_t)r;
setWords++;
src = next;
if (*src != ':' && src != eow)
@ -565,8 +565,8 @@ evutil_inet_pton(int af, const char *src, void *dst)
if (nToMove < 0)
return -1; /* should be impossible */
memmove(&words[gapPos+gapLen], &words[gapPos],
sizeof(uint16_t)*nToMove);
memset(&words[gapPos], 0, sizeof(uint16_t)*gapLen);
sizeof(ev_uint16_t)*nToMove);
memset(&words[gapPos], 0, sizeof(ev_uint16_t)*gapLen);
}
for (i = 0; i < 8; ++i) {
out->s6_addr[2*i ] = words[i] >> 8;

View File

@ -28,9 +28,11 @@
#ifndef _MIN_HEAP_H_
#define _MIN_HEAP_H_
#include "event-config.h"
#include "event2/event.h"
#include "event2/event_struct.h"
#include "event2/util.h"
#include "util-internal.h"
typedef struct min_heap
{

View File

@ -33,6 +33,14 @@
extern "C" {
#endif
/* If we need magic to say "inline", get it for free internally. */
#ifdef _EVENT_inline
#define inline _EVENT_inline
#endif
#ifdef _EVENT___func__
#define __func__ _EVENT___func__
#endif
/* A good no-op to use in macro definitions. */
#define _EVUTIL_NIL_STMT ((void)0)