From eeac5d2353907c0d91b8ace43f4908a0499efa28 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 16 Dec 2007 20:23:04 +0000 Subject: Try to get the 1.3 branch building better under MSVC. This solution is a hack, since we don't have an event-config.h file to work with. svn:r600 --- ChangeLog | 1 + WIN32-Code/config.h | 7 +- WIN32-Code/win32.c | 5 +- WIN32-Prj/libevent.sln | 20 ++++ WIN32-Prj/libevent.vcproj | 287 ++++++++++++++++++++++++++++++++++++++++++++++ event.h | 8 +- 6 files changed, 320 insertions(+), 8 deletions(-) create mode 100644 WIN32-Prj/libevent.sln create mode 100644 WIN32-Prj/libevent.vcproj diff --git a/ChangeLog b/ChangeLog index db403f45..e3935c51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Changes since 1.3e: o Remove == operator from autogen.sh so it works on non-bash shells. o bufferevent_write now uses a const source argument; report from Charles Kerr o Correctly handle DNS replies with no answers set (Fixes bug 1846282) + o Attempt to fix MSVC build. Changes since 1.3d: diff --git a/WIN32-Code/config.h b/WIN32-Code/config.h index aed9774d..776c653d 100644 --- a/WIN32-Code/config.h +++ b/WIN32-Code/config.h @@ -95,7 +95,7 @@ #undef HAVE_FCNTL_H /* Define if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 +#undef HAVE_GETTIMEOFDAY /* Define if you have the header file. */ #define HAVE_INTTYPES_H 1 @@ -197,7 +197,7 @@ #undef TIME_WITH_SYS_TIME /* Version number of package */ -#define VERSION "1.0b" +#define VERSION "1.3e" /* Define to empty if `const' does not conform to ANSI C. */ #undef const @@ -227,5 +227,8 @@ /* Define to `unsigned char' if does not define. */ /* #undef u_int8_t */ +#define uint32_t unsigned int +#define uint8_t unsigned char + /* Define to __FUNCTION__ or __file__ if your compiler doesn't have __func__ */ #define __func__ __FUNCTION__ diff --git a/WIN32-Code/win32.c b/WIN32-Code/win32.c index 79387f24..4cfc58f6 100644 --- a/WIN32-Code/win32.c +++ b/WIN32-Code/win32.c @@ -32,8 +32,6 @@ #include "../config.h" #endif -#include -#include #include #include #include @@ -43,9 +41,10 @@ #include #include #include +#include -#include "log.h" #include "event.h" +#include "log.h" #include "event-internal.h" #define XFREE(ptr) do { if (ptr) free(ptr); } while(0) diff --git a/WIN32-Prj/libevent.sln b/WIN32-Prj/libevent.sln new file mode 100644 index 00000000..f056f156 --- /dev/null +++ b/WIN32-Prj/libevent.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "libevent.vcproj", "{717D45D6-AAF9-4091-BBA0-244D86400EFC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {717D45D6-AAF9-4091-BBA0-244D86400EFC}.Debug|Win32.ActiveCfg = Debug|Win32 + {717D45D6-AAF9-4091-BBA0-244D86400EFC}.Debug|Win32.Build.0 = Debug|Win32 + {717D45D6-AAF9-4091-BBA0-244D86400EFC}.Release|Win32.ActiveCfg = Release|Win32 + {717D45D6-AAF9-4091-BBA0-244D86400EFC}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WIN32-Prj/libevent.vcproj b/WIN32-Prj/libevent.vcproj new file mode 100644 index 00000000..5744cc42 --- /dev/null +++ b/WIN32-Prj/libevent.vcproj @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/event.h b/event.h index d295fe24..accf388e 100644 --- a/event.h +++ b/event.h @@ -31,8 +31,10 @@ extern "C" { #endif +#ifndef _MSC_VER #include #include +#endif #include #ifdef WIN32 @@ -211,8 +213,8 @@ int event_priority_set(struct event *, int); /* These functions deal with buffering input and output */ struct evbuffer { - u_char *buffer; - u_char *orig_buffer; + unsigned char *buffer; + unsigned char *orig_buffer; size_t misalign; size_t totallen; @@ -290,7 +292,7 @@ int evbuffer_add_vprintf(struct evbuffer *, const char *fmt, va_list ap); void evbuffer_drain(struct evbuffer *, size_t); int evbuffer_write(struct evbuffer *, int); int evbuffer_read(struct evbuffer *, int, int); -u_char *evbuffer_find(struct evbuffer *, const u_char *, size_t); +unsigned char *evbuffer_find(struct evbuffer *, const unsigned char *, size_t); void evbuffer_setcb(struct evbuffer *, void (*)(struct evbuffer *, size_t, size_t, void *), void *); /* -- cgit v1.2.1