summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-12-16 20:23:04 +0000
committerNick Mathewson <nickm@torproject.org>2007-12-16 20:23:04 +0000
commiteeac5d2353907c0d91b8ace43f4908a0499efa28 (patch)
tree776f846bcac37f57ef17b3c66642fe47c9829a59
parent72cf634626e11025f73f3277d27e4b9f3b95d1d4 (diff)
downloadlibevent-eeac5d2353907c0d91b8ace43f4908a0499efa28.tar.gz
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
-rw-r--r--ChangeLog1
-rw-r--r--WIN32-Code/config.h7
-rw-r--r--WIN32-Code/win32.c5
-rw-r--r--WIN32-Prj/libevent.sln20
-rw-r--r--WIN32-Prj/libevent.vcproj287
-rw-r--r--event.h8
6 files changed, 320 insertions, 8 deletions
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 <inttypes.h> 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 <sys/types.h> 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 <windows.h>
-#include <winsock2.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/tree.h>
@@ -43,9 +41,10 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
+#include <winsock2.h>
-#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 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="libevent"
+ ProjectGUID="{717D45D6-AAF9-4091-BBA0-244D86400EFC}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\,..\WIN32-Code,..\compat"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;WIN32"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile=".\Debug/libevent.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile=".\Debug\libevent.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/libevent.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\,..\WIN32-Code,..\compat"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;WIN32"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\Release/libevent.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile=".\Release\libevent.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/libevent.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\event.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\log.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\WIN32-Code\misc.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\WIN32-Code\win32.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\WIN32-Code\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\compat\err.h"
+ >
+ </File>
+ <File
+ RelativePath="..\event.h"
+ >
+ </File>
+ <File
+ RelativePath="..\WIN32-Code\misc.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
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 <sys/time.h>
#include <stdint.h>
+#endif
#include <stdarg.h>
#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 *);
/*