Index: /zzuf/trunk/src/zzuf.c
===================================================================
--- /zzuf/trunk/src/zzuf.c	(revision 1728)
+++ /zzuf/trunk/src/zzuf.c	(revision 1729)
@@ -35,9 +35,9 @@
 #   include <regex.h>
 #endif
+#if defined HAVE_WINSOCK2_H
+#   include <winsock2.h>
+#endif
 #if defined HAVE_WINDOWS_H
 #   include <windows.h>
-#endif
-#if defined HAVE_WINSOCK2_H
-#   include <winsock2.h>
 #endif
 #if defined HAVE_IO_H
@@ -125,4 +125,8 @@
 #endif
     int i;
+#if !defined HAVE_GETOPT_H
+#   define MOREINFO "Usage: %s message...\n"
+    int optind = 1;
+#endif
 
     _zz_opts_init(opts);
@@ -300,7 +304,4 @@
         }
     }
-#else
-#   define MOREINFO "Usage: %s message...\n"
-    int optind = 1;
 #endif
 
Index: /zzuf/trunk/msvc/libzzuf.vcproj
===================================================================
--- /zzuf/trunk/msvc/libzzuf.vcproj	(revision 1729)
+++ /zzuf/trunk/msvc/libzzuf.vcproj	(revision 1729)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="libzzuf"
+	ProjectGUID="{E658DCE5-E1E5-41C8-910B-1CC2D73C435C}"
+	Keyword="ExtStoredProcProj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\msvc"
+				PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				ObjectFile="$(IntDir)/.libs/"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="opends60.lib imagehlp.lib"
+				LinkIncremental="2"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="FALSE"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="2"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\msvc"
+				PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL"
+				RuntimeLibrary="2"
+				ObjectFile="$(IntDir)/.libs/"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="opends60.lib imagehlp.lib"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="FALSE"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\src\debug.c">
+			</File>
+			<File
+				RelativePath="..\src\fd.c">
+			</File>
+			<File
+				RelativePath="..\src\fuzz.c">
+			</File>
+			<File
+				RelativePath="..\src\lib-fd.c">
+			</File>
+			<File
+				RelativePath="..\src\lib-mem.c">
+			</File>
+			<File
+				RelativePath="..\src\lib-signal.c">
+			</File>
+			<File
+				RelativePath="..\src\lib-stream.c">
+			</File>
+			<File
+				RelativePath="..\src\libzzuf.c">
+			</File>
+			<File
+				RelativePath="..\src\random.c">
+			</File>
+			<File
+				RelativePath="..\src\sys.c">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\config.h">
+			</File>
+			<File
+				RelativePath="..\src\debug.h">
+			</File>
+			<File
+				RelativePath="..\src\fd.h">
+			</File>
+			<File
+				RelativePath="..\src\fuzz.h">
+			</File>
+			<File
+				RelativePath="..\src\lib-load.h">
+			</File>
+			<File
+				RelativePath="..\src\libzzuf.h">
+			</File>
+			<File
+				RelativePath="..\src\random.h">
+			</File>
+			<File
+				RelativePath="..\src\sys.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: /zzuf/trunk/msvc/zzuf.sln
===================================================================
--- /zzuf/trunk/msvc/zzuf.sln	(revision 1729)
+++ /zzuf/trunk/msvc/zzuf.sln	(revision 1729)
@@ -0,0 +1,29 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zzuf", "zzuf.vcproj", "{2E5723ED-A886-45A9-AAAC-3D02F2EFC358}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzzuf", "libzzuf.vcproj", "{E658DCE5-E1E5-41C8-910B-1CC2D73C435C}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{2E5723ED-A886-45A9-AAAC-3D02F2EFC358}.Debug.ActiveCfg = Debug|Win32
+		{2E5723ED-A886-45A9-AAAC-3D02F2EFC358}.Debug.Build.0 = Debug|Win32
+		{2E5723ED-A886-45A9-AAAC-3D02F2EFC358}.Release.ActiveCfg = Release|Win32
+		{2E5723ED-A886-45A9-AAAC-3D02F2EFC358}.Release.Build.0 = Release|Win32
+		{E658DCE5-E1E5-41C8-910B-1CC2D73C435C}.Debug.ActiveCfg = Debug|Win32
+		{E658DCE5-E1E5-41C8-910B-1CC2D73C435C}.Debug.Build.0 = Debug|Win32
+		{E658DCE5-E1E5-41C8-910B-1CC2D73C435C}.Release.ActiveCfg = Release|Win32
+		{E658DCE5-E1E5-41C8-910B-1CC2D73C435C}.Release.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: /zzuf/trunk/msvc/config.h
===================================================================
--- /zzuf/trunk/msvc/config.h	(revision 1729)
+++ /zzuf/trunk/msvc/config.h	(revision 1729)
@@ -0,0 +1,43 @@
+/*
+ *  zzuf - general purpose fuzzer
+ *  Copyright (c) 2006, 2007 Sam Hocevar <sam@zoy.org>
+ *                All Rights Reserved
+ *
+ *  $Id: timer.h 192 2007-01-12 15:47:48Z sam $
+ *
+ *  This program is free software. It comes without any warranty, to
+ *  the extent permitted by applicable law. You can redistribute it
+ *  and/or modify it under the terms of the Do What The Fuck You Want
+ *  To Public License, Version 2, as published by Sam Hocevar. See
+ *  http://sam.zoy.org/wtfpl/COPYING for more details.
+ */
+
+/*
+ *  config.h: MSVC-specific configuration file
+ */
+
+#define VERSION "0.7 (msvc)"
+
+#define HAVE_WINDOWS_H 1
+#define HAVE_WINSOCK2_H 1
+#define HAVE_IO_H 1
+
+/* Win32-specific, of course. */
+typedef signed long long int int64_t;
+typedef unsigned long long int uint64_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+
+typedef unsigned long int uintptr_t;
+typedef long int intptr_t;
+typedef int pid_t;
+
+#define inline /* undefined */
+#define __attribute__(x) /* undefined */
+
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
Index: /zzuf/trunk/msvc/zzuf.vcproj
===================================================================
--- /zzuf/trunk/msvc/zzuf.vcproj	(revision 1729)
+++ /zzuf/trunk/msvc/zzuf.vcproj	(revision 1729)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="zzuf"
+	ProjectGUID="{2E5723ED-A886-45A9-AAAC-3D02F2EFC358}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\msvc"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="5"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib"
+				OutputFile="$(OutDir)/zzuf.exe"
+				LinkIncremental="2"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/zzuf.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\msvc"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="4"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib"
+				OutputFile="$(OutDir)/zzuf.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="..\src\fd.c">
+			</File>
+			<File
+				RelativePath="..\src\fuzz.c">
+			</File>
+			<File
+				RelativePath="..\src\md5.c">
+			</File>
+			<File
+				RelativePath="..\src\opts.c">
+			</File>
+			<File
+				RelativePath="..\src\random.c">
+			</File>
+			<File
+				RelativePath="..\src\timer.c">
+			</File>
+			<File
+				RelativePath="..\src\zzuf.c">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\config.h">
+			</File>
+			<File
+				RelativePath="..\src\fd.h">
+			</File>
+			<File
+				RelativePath="..\src\fuzz.h">
+			</File>
+			<File
+				RelativePath="..\src\md5.h">
+			</File>
+			<File
+				RelativePath="..\src\opts.h">
+			</File>
+			<File
+				RelativePath="..\src\random.h">
+			</File>
+			<File
+				RelativePath="..\src\timer.h">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
