]> granicus.if.org Git - libevent/commitdiff
Make all the C files in the libraries compile under MSVC 2005 Express. There are...
authorNick Mathewson <nickm@torproject.org>
Wed, 7 Nov 2007 21:01:26 +0000 (21:01 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 7 Nov 2007 21:01:26 +0000 (21:01 +0000)
svn:r499

17 files changed:
WIN32-Code/config.h
WIN32-Code/event-config.h [new file with mode: 0644]
WIN32-Code/misc.c
WIN32-Code/win32.c
WIN32-Prj/libevent.vcproj [new file with mode: 0644]
buffer.c
configure.in
evbuffer.c
evdns.c
evdns.h
event.h
event_tagging.c
evrpc.c
evutil.h
http.c
min_heap.h
signal.c

index aed9774d469ebcf77303ff08ba3e3c146766ef27..88b2a513201ad59e68b00cb878979dc90c368be9 100644 (file)
-/* config.h.in.  Generated automatically from configure.in by autoheader.  */
-/* Define if kqueue works correctly with pipes */
-#undef HAVE_WORKING_KQUEUE
+/* config.h.  Generated by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
 
-/* Define to `unsigned long long' if <sys/types.h> doesn't define.  */
-#undef u_int64_t
+/* Define if clock_gettime is available in libc */
+/* #undef DNS_USE_CPU_CLOCK_FOR_ID */
 
-/* Define to `unsigned int' if <sys/types.h> doesn't define.  */
-#undef u_int32_t
+/* Define if no secure id variant is available */
+#define DNS_USE_FTIME_FOR_ID 1
 
-/* Define to `unsigned short' if <sys/types.h> doesn't define.  */
-#undef u_int16_t
+/* Define if no secure id variant is available */
+/* #define DNS_USE_GETTIMEOFDAY_FOR_ID 1 */
 
-/* Define to `unsigned char' if <sys/types.h> doesn't define.  */
-#undef u_int8_t
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef HAVE_CLOCK_GETTIME */
 
-/* Define if timeradd is defined in <sys/time.h> */
-#undef HAVE_TIMERADD
-#ifndef HAVE_TIMERADD
-#undef timersub
-#define timeradd(tvp, uvp, vvp)                                                \
-       do {                                                            \
-               (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec;          \
-               (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec;       \
-               if ((vvp)->tv_usec >= 1000000) {                        \
-                       (vvp)->tv_sec++;                                \
-                       (vvp)->tv_usec -= 1000000;                      \
-               }                                                       \
-       } while (0)
-#define        timersub(tvp, uvp, vvp)                                         \
-       do {                                                            \
-               (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;          \
-               (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec;       \
-               if ((vvp)->tv_usec < 0) {                               \
-                       (vvp)->tv_sec--;                                \
-                       (vvp)->tv_usec += 1000000;                      \
-               }                                                       \
-       } while (0)
-#endif /* !HAVE_TIMERADD */
-
-#undef HAVE_TIMERCLEAR
-#ifndef HAVE_TIMERCLEAR
-#define        timerclear(tvp)         (tvp)->tv_sec = (tvp)->tv_usec = 0
-#endif
+/* Define if /dev/poll is available */
+/* #undef HAVE_DEVPOLL */
 
-#define HAVE_TIMERCMP
-#ifndef HAVE_TIMERCMP
-#undef timercmp
-#define        timercmp(tvp, uvp, cmp)                                         \
-       (((tvp)->tv_sec == (uvp)->tv_sec) ?                             \
-           ((tvp)->tv_usec cmp (uvp)->tv_usec) :                       \
-           ((tvp)->tv_sec cmp (uvp)->tv_sec))
-#endif
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
 
-#undef HAVE_TIMERISSET
-#ifndef HAVE_TIMERISSET
-#undef timerisset
-#define        timerisset(tvp)         ((tvp)->tv_sec || (tvp)->tv_usec)
-#endif
+/* Define if your system supports the epoll system calls */
+/* #undef HAVE_EPOLL */
 
-/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
-#define HAVE_TAILQFOREACH
-#ifndef HAVE_TAILQFOREACH
-#define        TAILQ_FIRST(head)               ((head)->tqh_first)
-#define        TAILQ_END(head)                 NULL
-#define        TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
-#define TAILQ_FOREACH(var, head, field)                                        \
-       for((var) = TAILQ_FIRST(head);                                  \
-           (var) != TAILQ_END(head);                                   \
-           (var) = TAILQ_NEXT(var, field))
-#define        TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   \
-       (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
-       (elm)->field.tqe_next = (listelm);                              \
-       *(listelm)->field.tqe_prev = (elm);                             \
-       (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
-} while (0)
-#endif /* TAILQ_FOREACH */
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef HAVE_EPOLL_CTL */
 
-/* Define if /dev/poll is available */
-#undef HAVE_DEVPOLL
+/* Define if your system supports event ports */
+/* #undef HAVE_EVENT_PORTS */
 
-/* Define if your system supports the epoll system calls */
-#undef HAVE_EPOLL
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef HAVE_FCNTL */
 
-/* Define if you have the `epoll_ctl' function. */
-#undef HAVE_EPOLL_CTL
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
 
-/* Define if you have the `err' function. */
-#undef HAVE_ERR
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef HAVE_GETADDRINFO */
 
-/* Define if you have the `fcntl' function. */
-#undef HAVE_FCNTL
+/* Define to 1 if you have the `getnameinfo' function. */
+/* #undef HAVE_GETNAMEINFO */
 
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #define HAVE_GETTIMEOFDAY 1 */
 
-/* Define if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
+/* Define to 1 if you have the `inet_ntop' function. */
+/* #undef HAVE_INET_NTOP */
 
-/* Define if you have the <inttypes.h> header file. */
+/* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
-/* Define if you have the `kqueue' function. */
-#undef HAVE_KQUEUE
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef HAVE_KQUEUE */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+/* #undef HAVE_LIBRESOLV */
 
-/* Define if you have the `socket' library (-lsocket). */
-#undef HAVE_LIBSOCKET
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef HAVE_LIBRT */
 
-/* Define if you have the <memory.h> header file. */
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the <memory.h> header file. */
 #define HAVE_MEMORY_H 1
 
-/* Define if you have the `poll' function. */
-#undef HAVE_POLL
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the `poll' function. */
+/* #undef HAVE_POLL */
 
-/* Define if you have the <poll.h> header file. */
-#undef HAVE_POLL_H
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef HAVE_POLL_H */
 
-/* Define if your system supports POSIX realtime signals */
-#undef HAVE_RTSIG
+/* Define to 1 if you have the `port_create' function. */
+/* #undef HAVE_PORT_CREATE */
 
-/* Define if you have the `select' function. */
-#undef HAVE_SELECT
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef HAVE_SELECT */
 
 /* Define if F_SETFD is defined in <fcntl.h> */
-#undef HAVE_SETFD
+/* #undef HAVE_SETFD */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
 
-/* Define if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
+/* Define to 1 if you have the `signal' function. */
+#define HAVE_SIGNAL 1
 
-/* Define if you have the `sigtimedwait' function. */
-#undef HAVE_SIGTIMEDWAIT
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
 
-/* Define if you have the <stdarg.h> header file. */
+/* Define to 1 if you have the <stdarg.h> header file. */
 #define HAVE_STDARG_H 1
 
-/* Define if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #define HAVE_STDINT_H 1 */
 
-/* Define if you have the <stdlib.h> header file. */
+/* Define to 1 if you have the <stdlib.h> header file. */
 #define HAVE_STDLIB_H 1
 
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
 
-/* Define if you have the <string.h> header file. */
+/* Define to 1 if you have the <string.h> header file. */
 #define HAVE_STRING_H 1
 
-/* Define if you have the <sys/devpoll.h> header file. */
-#undef HAVE_SYS_DEVPOLL_H
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef HAVE_STRSEP */
+
+/* Define to 1 if you have the `strtok_r' function. */
+/* #undef HAVE_STRTOK_R */
 
-/* Define if you have the <sys/epoll.h> header file. */
-#undef HAVE_SYS_EPOLL_H
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define HAVE_STRUCT_IN6_ADDR 1
 
-/* Define if you have the <sys/event.h> header file. */
-#undef HAVE_SYS_EVENT_H
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef HAVE_SYS_DEVPOLL_H */
 
-/* Define if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef HAVE_SYS_EPOLL_H */
 
-/* Define if you have the <sys/queue.h> header file. */
-#undef HAVE_SYS_QUEUE_H
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef HAVE_SYS_EVENT_H */
 
-/* Define if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
 
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
+/* Define to 1 if you have the <sys/queue.h> header file. */
+/* #undef HAVE_SYS_QUEUE_H */
 
-/* Define if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+/* #define HAVE_SYS_STAT_H 1 */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #define HAVE_SYS_TIME_H 1 */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+/* #define HAVE_SYS_TYPES_H 1 */
 
 /* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
-#undef HAVE_TAILQFOREACH
+/* #undef HAVE_TAILQFOREACH */
 
 /* Define if timeradd is defined in <sys/time.h> */
-#undef HAVE_TIMERADD
+/* #undef HAVE_TIMERADD */
 
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
+/* Define if timerclear is defined in <sys/time.h> */
+/* #define HAVE_TIMERCLEAR 1 */
 
-/* Define if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
+/* Define if timercmp is defined in <sys/time.h> */
+#define HAVE_TIMERCMP 1
 
-/* Define if kqueue works correctly with pipes */
-#undef HAVE_WORKING_KQUEUE
+/* Define if timerisset is defined in <sys/time.h> */
+#define HAVE_TIMERISSET 1
 
-/* Define if realtime signals work on pipes */
-#undef HAVE_WORKING_RTSIG
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #define HAVE_UNISTD_H 1 */
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef HAVE_VASPRINTF */
+
+/* Define if kqueue works correctly with pipes */
+/* #undef HAVE_WORKING_KQUEUE */
 
 /* Name of package */
 #define PACKAGE "libevent"
 
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
 
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
 
 /* Version number of package */
-#define VERSION "1.0b"
+#define VERSION "1.3.99-trunk"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+#define __func__ __FUNCTION__
 
 /* Define to empty if `const' does not conform to ANSI C. */
-#undef const
+/* #undef const */
 
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
-   if it is not supported. */
+/* 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 __cplusplus
 #define inline __inline
+#endif
 
 /* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
+/* #undef pid_t */
 
 /* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
+/* #undef size_t */
 
 /* Define to unsigned int if you dont have it */
-#undef socklen_t
+#define socklen_t unsigned int
 
 /* Define to `unsigned short' if <sys/types.h> does not define. */
-#undef u_int16_t
+#define uint16_t unsigned short
 
 /* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef u_int32_t
+#define uint32_t unsigned int
 
 /* Define to `unsigned long long' if <sys/types.h> does not define. */
-/* #undef u_int64_t */
+#define uint64_t __uint64_t
 
 /* Define to `unsigned char' if <sys/types.h> does not define. */
-/* #undef u_int8_t */
-
-/* Define to __FUNCTION__ or __file__ if your compiler doesn't have __func__ */
-#define __func__ __FUNCTION__
+#define uint8_t unsigned char
diff --git a/WIN32-Code/event-config.h b/WIN32-Code/event-config.h
new file mode 100644 (file)
index 0000000..a0cf8ef
--- /dev/null
@@ -0,0 +1,244 @@
+/* event-config.h
+ * Generated by autoconf; post-processed by libevent.
+ * Do not edit this file.
+ * Do not rely on macros in this file existing in later versions.
+ */
+#ifndef _EVENT_CONFIG_H_
+#define _EVENT_CONFIG_H_
+/* config.h.  Generated by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* 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 `clock_gettime' function. */
+/* #undef _EVENT_HAVE_CLOCK_GETTIME */
+
+/* Define if /dev/poll is available */
+/* #undef _EVENT_HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef _EVENT_HAVE_DLFCN_H */
+
+/* Define if your system supports the epoll system calls */
+/* #undef _EVENT_HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef _EVENT_HAVE_EPOLL_CTL */
+
+/* Define if your system supports event ports */
+/* #undef _EVENT_HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef _EVENT_HAVE_FCNTL */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define _EVENT_HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+/* #undef _EVENT_HAVE_GETADDRINFO */
+
+/* Define to 1 if you have the `getnameinfo' function. */
+/* #undef _EVENT_HAVE_GETNAMEINFO */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #define _EVENT_HAVE_GETTIMEOFDAY 1 */
+
+/* Define to 1 if you have the `inet_ntop' function. */
+/* #undef _EVENT_HAVE_INET_NTOP */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#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 to 1 if you have the <memory.h> header file. */
+#define _EVENT_HAVE_MEMORY_H 1
+
+/* 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 `poll' function. */
+/* #undef _EVENT_HAVE_POLL */
+
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef _EVENT_HAVE_POLL_H */
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef _EVENT_HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef _EVENT_HAVE_PORT_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef _EVENT_HAVE_SELECT */
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+/* #undef _EVENT_HAVE_SETFD */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef _EVENT_HAVE_SIGACTION */
+
+/* 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 <stdarg.h> header file. */
+#define _EVENT_HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #define _EVENT_HAVE_STDINT_H 1 */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define _EVENT_HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define _EVENT_HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define _EVENT_HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef _EVENT_HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef _EVENT_HAVE_STRSEP */
+
+/* Define to 1 if you have the `strtok_r' function. */
+/* #undef _EVENT_HAVE_STRTOK_R */
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
+
+/* 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/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/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/socket.h> header file. */
+/* #undef _EVENT_HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define _EVENT_HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #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 if TAILQ_FOREACH is defined in <sys/queue.h> */
+/* #undef _EVENT_HAVE_TAILQFOREACH */
+
+/* Define if timeradd is defined in <sys/time.h> */
+/* #undef _EVENT_HAVE_TIMERADD */
+
+/* Define if timerclear is defined in <sys/time.h> */
+/* #define _EVENT_HAVE_TIMERCLEAR 1 */
+
+/* Define if timercmp is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERCMP 1
+
+/* Define if timerisset is defined in <sys/time.h> */
+#define _EVENT_HAVE_TIMERISSET 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #define _EVENT_HAVE_UNISTD_H 1 */
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef _EVENT_HAVE_VASPRINTF */
+
+/* Define if kqueue works correctly with pipes */
+/* #undef _EVENT_HAVE_WORKING_KQUEUE */
+
+/* Name of package */
+#define _EVENT_PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define _EVENT_PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define _EVENT_PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define _EVENT_PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define _EVENT_PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define _EVENT_PACKAGE_VERSION ""
+
+/* Define to 1 if you have the ANSI C header files. */
+#define _EVENT_STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define _EVENT_TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define _EVENT_VERSION "1.3.99-trunk"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+/* #undef _EVENT___func__ */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #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
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef _EVENT_pid_t */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef _EVENT_size_t */
+
+/* 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
index 4de0f4292ca9239bae044676348bc64bd68e89ee..9619ee33505a425004eac83e2da6ab0201a3f398 100644 (file)
 
 #ifndef HAVE_GETTIMEOFDAY
 int gettimeofday(struct timeval *tv, struct timezone *tz) {
-  struct _timeb tb;
+       struct _timeb tb;
 
        if(tv == NULL)
                return -1;
 
        _ftime(&tb);
-       tv->tv_sec = tb.time;
+       tv->tv_sec = (long) tb.time;
        tv->tv_usec = ((int) tb.millitm) * 1000;
        return 0;
 }
index 4424099175d1afff8ea5f8779d4ac9483df2cd57..135a7f3e73fc209cc3573c904ebd894f432bc17c 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #ifdef _MSC_VER
-#include "config.h"
+#include "./config.h"
 #else
 /* Avoid the windows/msvc thing. */
 #include "../config.h"
 #endif
 
-#include <windows.h>
 #include <winsock2.h>
+#include <windows.h>
 #include <sys/types.h>
 #include <sys/queue.h>
 #include <signal.h>
diff --git a/WIN32-Prj/libevent.vcproj b/WIN32-Prj/libevent.vcproj
new file mode 100644 (file)
index 0000000..f69730c
--- /dev/null
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="libevent"\r
+       ProjectGUID="{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory=".\Debug"\r
+                       IntermediateDirectory=".\Debug"\r
+                       ConfigurationType="4"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\,..\WIN32-Code,..\compat"\r
+                               PreprocessorDefinitions="WIN32,HAVE_CONFIG_H,_CRT_SECURE_NO_DEPRECATE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="1"\r
+                               PrecompiledHeaderFile=".\Debug/libevent.pch"\r
+                               AssemblerListingLocation=".\Debug/"\r
+                               ObjectFile=".\Debug/"\r
+                               ProgramDataBaseFileName=".\Debug/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="4"\r
+                               CompileAs="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile=".\Debug\libevent.lib"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                               SuppressStartupBanner="true"\r
+                               OutputFile=".\Debug/libevent.bsc"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory=".\Release"\r
+                       IntermediateDirectory=".\Release"\r
+                       ConfigurationType="4"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories="..\,..\WIN32-Code,..\compat"\r
+                               PreprocessorDefinitions="WIN32,HAVE_CONFIG_H,_CRT_SECURE_NO_DEPRECATE"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="0"\r
+                               EnableFunctionLevelLinking="true"\r
+                               PrecompiledHeaderFile=".\Release/libevent.pch"\r
+                               AssemblerListingLocation=".\Release/"\r
+                               ObjectFile=".\Release/"\r
+                               ProgramDataBaseFileName=".\Release/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               CompileAs="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile=".\Release\libevent.lib"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                               SuppressStartupBanner="true"\r
+                               OutputFile=".\Release/libevent.bsc"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\buffer.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evbuffer.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evdns.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\event.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\event_tagging.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evrpc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evutil.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\http.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\log.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\WIN32-Code\misc.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\signal.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\strlcpy.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\WIN32-Code\win32.c"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               AdditionalIncludeDirectories=""\r
+                                               PreprocessorDefinitions=""\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\WIN32-Code\config.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evdns.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\WIN32-Code\event-config.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\event-internal.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\event.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evhttp.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evrpc-internal.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evrpc.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evsignal.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\evutil.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\http-internal.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\min_heap.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\WIN32-Code\misc.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\strlcpy-internal.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 5b0208a4ed6ccffc81b07e34abe66d612fb3a8c6..5443263c2c0c9ed3d89c9acdcbfbed11fde93569 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -30,8 +30,8 @@
 #endif
 
 #ifdef WIN32
-#include <windows.h>
 #include <winsock2.h>
+#include <windows.h>
 #endif
 
 #ifdef HAVE_VASPRINTF
@@ -62,6 +62,7 @@
 #endif
 
 #include "event.h"
+#include "config.h"
 
 struct evbuffer *
 evbuffer_new(void)
index 0cbf02967e145f25581fe5297eb41ff6d4690d95..9e031aa2717962b1d042ff35fec121afa872ac4c 100644 (file)
@@ -37,7 +37,7 @@ AC_CHECK_LIB(nsl, inet_ntoa)
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h stdarg.h inttypes.h stdint.h poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in6.h sys/socket.h)
+AC_CHECK_HEADERS(fcntl.h stdarg.h inttypes.h stdint.h poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in6.h sys/socket.h)
 if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
        AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
        AC_EGREP_CPP(yes,
index f968bb5aa6c6ba2af60758b5857b5e0a695cacfa..f4e839c274a2827c5bfd7e0ce1c31c883c91740d 100644 (file)
 #include <stdarg.h>
 #endif
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 #include "evutil.h"
 #include "event.h"
 
diff --git a/evdns.c b/evdns.c
index e1f0fba27511aae02d03692972655b9bfa96c04e..06b9fcdc7b05a700ad4b37ab4ee6e340a9833bac 100644 (file)
--- a/evdns.c
+++ b/evdns.c
 #include "misc.h"
 #endif
 
+#ifdef DNS_USE_FTIME_FOR_ID
+#include <sys/timeb.h>
+#endif
+
 /* #define NDEBUG */
 
 #ifndef DNS_USE_CPU_CLOCK_FOR_ID
 #ifndef DNS_USE_GETTIMEOFDAY_FOR_ID
 #ifndef DNS_USE_OPENSSL_FOR_ID
+#ifndef DNS_USE_FTIME_FOR_ID
 #error Must configure at least one id generation method.
 #error Please see the documentation.
 #endif
 #endif
 #endif
+#endif
 
 /* #define _POSIX_C_SOURCE 200507 */
 #define _GNU_SOURCE
@@ -78,7 +84,9 @@
 
 #include <string.h>
 #include <fcntl.h>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
@@ -86,7 +94,9 @@
 #include <string.h>
 #include <errno.h>
 #include <assert.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <limits.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include "evutil.h"
 #include "log.h"
 #ifdef WIN32
-#include <windows.h>
 #include <winsock2.h>
+#include <windows.h>
 #include <iphlpapi.h>
+#include <io.h>
 #else
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -131,10 +142,18 @@ typedef unsigned int uint;
 #endif
 #include <event.h>
 
-#define u64 uint64_t
-#define u32 uint32_t
-#define u16 uint16_t
-#define u8  uint8_t
+#define u64 ev_uint64_t
+#define u32 ev_uint32_t
+#define u16 ev_uint16_t
+#define u8  ev_uint8_t
+
+#ifdef WIN32
+#define snprintf _snprintf
+#define open _open
+#define read _read
+#define close _close
+#define strdup _strdup
+#endif
 
 #define MAX_ADDRS 32  /* maximum number of addresses from a single packet */
 /* which we bother recording */
@@ -316,7 +335,7 @@ static int search_request_new(int type, const char *const name, int flags, evdns
 static void evdns_requests_pump_waiting_queue(void);
 static u16 transaction_id_pick(void);
 static struct request *request_new(int type, const char *name, int flags, evdns_callback_type callback, void *ptr);
-static void request_submit(struct request *req);
+static void request_submit(struct request *const req);
 
 static int server_request_free(struct server_request *req);
 static void server_request_free_answers(struct server_request *req);
@@ -1029,6 +1048,12 @@ default_transaction_id_fn(void)
        trans_id = ts.tv_nsec & 0xffff;
 #endif
 
+#ifdef DNS_USE_FTIME_FOR_ID
+       struct _timeb tb;
+       _ftime(&tb);
+       trans_id = tb.millitm & 0xffff;
+#endif
+
 #ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
        struct timeval tv;
        gettimeofday(&tv, NULL);
@@ -1636,7 +1661,7 @@ evdns_server_request_format_response(struct server_request *req, int err)
                                if (r < 0)
                                        goto overflow;
                                j = r;
-                               _t = htons( (j-name_start) );
+                               _t = htons( (short) (j-name_start) );
                                memcpy(buf+len_idx, &_t, 2);
                        } else {
                                APPEND16(item->datalen);
diff --git a/evdns.h b/evdns.h
index 7922c9df52c77aafa6f8cc96a632e35bfcf03715..0ad22712962bca7649e6f9ee9aaec7e83a279241 100644 (file)
--- a/evdns.h
+++ b/evdns.h
 extern "C" {
 #endif
 
-#include <stdint.h>
+/* For integer types. */
+#include <evutil.h>
 
 /** Error codes 0-5 are as described in RFC 1035. */
 #define DNS_ERR_NONE 0
@@ -397,7 +398,7 @@ int evdns_set_option(const char *option, const char *val, int flags);
           occurred (see above)
   @see resolv.conf(3), evdns_config_windows_nameservers()
  */
-int evdns_resolv_conf_parse(int flags, const char *filename);
+int evdns_resolv_conf_parse(int flags, const char *const filename);
 
 
 /**
@@ -461,7 +462,7 @@ void evdns_set_log_fn(evdns_debug_log_fn_type fn);
 
    @param fn the new callback, or NULL to use the default.
  */
-void evdns_set_transaction_id_fn(uint16_t (*fn)(void));
+void evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void));
 
 #define DNS_NO_SEARCH 1
 
diff --git a/event.h b/event.h
index 6af47206e0a301609da11e80b0d68263c3c1941f..7eeaccbc624eb753e716cad50b220cadfd8181a4 100644 (file)
--- a/event.h
+++ b/event.h
@@ -163,10 +163,17 @@ extern "C" {
 #ifdef _EVENT_HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
+#ifdef _EVENT_HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#ifdef _EVENT_HAVE_STDINT_H
 #include <stdint.h>
+#endif
 #include <stdarg.h>
 
+/* For int types. */
+#include <evutil.h>
+
 #ifdef WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -1000,8 +1007,8 @@ void evbuffer_setcb(struct evbuffer *, void (*)(struct evbuffer *, size_t, size_
 
 void evtag_init(void);
 
-void evtag_marshal(struct evbuffer *evbuf, uint8_t tag, const void *data,
-    uint32_t len);
+void evtag_marshal(struct evbuffer *evbuf, ev_uint8_t tag, const void *data,
+    ev_uint32_t len);
 
 /**
   Encode an integer and store it in an evbuffer.
@@ -1013,34 +1020,34 @@ void evtag_marshal(struct evbuffer *evbuf, uint8_t tag, const void *data,
   @param evbuf evbuffer to store the encoded number
   @param number a 32-bit integer
  */
-void encode_int(struct evbuffer *evbuf, uint32_t number);
+void encode_int(struct evbuffer *evbuf, ev_uint32_t number);
 
-void evtag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer);
+void evtag_marshal_int(struct evbuffer *evbuf, ev_uint8_t tag, ev_uint32_t integer);
 
-void evtag_marshal_string(struct evbuffer *buf, uint8_t tag,
+void evtag_marshal_string(struct evbuffer *buf, ev_uint8_t tag,
     const char *string);
 
-void evtag_marshal_timeval(struct evbuffer *evbuf, uint8_t tag,
+void evtag_marshal_timeval(struct evbuffer *evbuf, ev_uint8_t tag,
     struct timeval *tv);
 
 void evtag_test(void);
 
-int evtag_unmarshal(struct evbuffer *src, uint8_t *ptag, struct evbuffer *dst);
-int evtag_peek(struct evbuffer *evbuf, uint8_t *ptag);
-int evtag_peek_length(struct evbuffer *evbuf, uint32_t *plength);
-int evtag_payload_length(struct evbuffer *evbuf, uint32_t *plength);
+int evtag_unmarshal(struct evbuffer *src, ev_uint8_t *ptag, struct evbuffer *dst);
+int evtag_peek(struct evbuffer *evbuf, ev_uint8_t *ptag);
+int evtag_peek_length(struct evbuffer *evbuf, ev_uint32_t *plength);
+int evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength);
 int evtag_consume(struct evbuffer *evbuf);
 
-int evtag_unmarshal_int(struct evbuffer *evbuf, uint8_t need_tag,
-    uint32_t *pinteger);
+int evtag_unmarshal_int(struct evbuffer *evbuf, ev_uint8_t need_tag,
+    ev_uint32_t *pinteger);
 
-int evtag_unmarshal_fixed(struct evbuffer *src, uint8_t need_tag, void *data,
+int evtag_unmarshal_fixed(struct evbuffer *src, ev_uint8_t need_tag, void *data,
     size_t len);
 
-int evtag_unmarshal_string(struct evbuffer *evbuf, uint8_t need_tag,
+int evtag_unmarshal_string(struct evbuffer *evbuf, ev_uint8_t need_tag,
     char **pstring);
 
-int evtag_unmarshal_timeval(struct evbuffer *evbuf, uint8_t need_tag,
+int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint8_t need_tag,
     struct timeval *ptv);
 
 #ifdef __cplusplus
index 93ded7e5fa0c53221d3cfbf760bd055f429312d7..1646fb1001572ceb9dfb7b433fe5d74ddb7d5988 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/types.h>
-#include <sys/param.h>
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
 #ifdef WIN32
 #define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
 #else
@@ -52,7 +57,9 @@
 #ifndef WIN32
 #include <syslog.h>
 #endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "event.h"
 #include "log.h"
diff --git a/evrpc.c b/evrpc.c
index 8c9031a923bb66047a6fe8382010ddf311fe8f68..7e1c8e3608c8d6f97412b77b54fc7c62976dcff7 100644 (file)
--- a/evrpc.c
+++ b/evrpc.c
@@ -42,8 +42,6 @@
 #endif
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
-#include <sys/_time.h>
 #endif
 #include <sys/queue.h>
 #include <stdio.h>
index ca57e6ce8e6acfd0c304233bd28e83e3480c3762..d156e6636e950463bfbd1c518e625dd14d38af39 100644 (file)
--- a/evutil.h
+++ b/evutil.h
@@ -109,6 +109,19 @@ int evutil_make_socket_nonblocking(int sock);
 #define        evutil_timerisset(tvp)  ((tvp)->tv_sec || (tvp)->tv_usec)
 #endif
 
+#ifdef _EVENT_HAVE_STDINT_H
+#include <stdint.h>
+#define ev_uint64_t    uint64_t
+#define ev_uint32_t    uint32_t
+#define ev_uint16_t    uint16_t
+#define ev_uint8_t     uint8_t
+#elif defined(WIN32)
+#define ev_uint64_t    __uint64_t
+#define ev_uint32_t    unsigned int
+#define ev_uint16_t    unsigned short
+#define ev_uint8_t     unsigned char
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/http.c b/http.c
index bd55b2583f2ece24a575d500fd31cafe20ba14e6..064625384e39900f6128d6a2f79ad7d861c4a64c 100644 (file)
--- a/http.c
+++ b/http.c
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/param.h>
-#include <sys/types.h>
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 #include <netdb.h>
 #endif
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #endif
 #include <signal.h>
 #include <time.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
 
 #undef timeout_pending
 #undef timeout_initialized
 #include "log.h"
 #include "http-internal.h"
 
+#ifdef WIN32
+#define snprintf _snprintf
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+#define strdup _strdup
+#endif
+
 #ifndef HAVE_GETADDRINFO
 struct addrinfo {
        int ai_family;
index 8ffb35757f2fed60b732fbe336e55136d0b252f6..389d6dbed4eebc005b7c399a1656d309f107d3a1 100644 (file)
@@ -83,7 +83,7 @@ struct event* min_heap_pop(min_heap_t* s)
 
 int min_heap_erase(min_heap_t* s, struct event* e)
 {
-    if(-1u != e->min_heap_idx)
+    if(((unsigned int)-1) != e->min_heap_idx)
     {
         min_heap_shift_down_(s, e->min_heap_idx, s->p[--s->n]);
         e->min_heap_idx = -1;
index fa233e4e12fba1656935b18be96f639202068a96..3636b4f44efed0aceeaea67f11cc3938bb482234 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -39,8 +39,6 @@
 #include <sys/types.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
-#include <sys/_time.h>
 #endif
 #include <sys/queue.h>
 #ifdef HAVE_SYS_SOCKET_H
@@ -50,7 +48,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <errno.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
@@ -73,7 +73,11 @@ evsignal_cb(int fd, short what, void *arg)
 {
        static char signals[100];
        struct event *ev = arg;
+#ifdef WIN32
+       SSIZE_T n;
+#else
        ssize_t n;
+#endif
 
        n = recv(fd, signals, sizeof(signals), 0);
        if (n == -1)