BIND 10 trac2351, updated. 2059929f02704c5410ea1cba9f392e15b08c5284 WIN32 port: build environment and src/lib/exceptions (including tests)
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 11 22:54:15 UTC 2012
The branch, trac2351 has been updated
via 2059929f02704c5410ea1cba9f392e15b08c5284 (commit)
from 5fadea676fc73e068977173bb62b58d04fedf52c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2059929f02704c5410ea1cba9f392e15b08c5284
Author: Francis Dupont <fdupont at isc.org>
Date: Fri Oct 12 00:53:52 2012 +0200
WIN32 port: build environment and src/lib/exceptions (including tests)
-----------------------------------------------------------------------
Summary of changes:
doc/version.ent.win32 | 1 +
ext/coroutine/coroutine.h | 23 +-
.../resolver/common.h => lib/exceptions/dll.h} | 23 +-
src/lib/exceptions/exceptions.cc | 2 +
src/lib/exceptions/exceptions.h | 78 ++-
win32build/BINDInstall/BINDInstall.cpp | 11 +
win32build/BINDInstall/stdafx.cpp | 8 +
win32build/BINDInstall/stdafx.h | 15 +
win32build/BINDInstall/targetver.h | 8 +
win32build/VS/BINDInstall/BINDInstall.vcxproj | 89 ++++
.../VS/BINDInstall/BINDInstall.vcxproj.filters | 33 ++
win32build/VS/BINDInstall/BINDInstall.vcxproj.user | 3 +
win32build/VS/bind10.sln | 53 ++
.../VS/exceptions-tests/exceptions-tests.vcxproj | 172 +++++++
.../exceptions-tests.vcxproj.filters | 25 +
.../exceptions-tests/exceptions-tests.vcxproj.user | 3 +
.../VS/libb10-exceptions/libb10-exceptions.vcxproj | 208 ++++++++
.../libb10-exceptions.vcxproj.filters | 33 ++
.../libb10-exceptions.vcxproj.user | 3 +
win32build/WIN32-NOTES | 303 ++++++++++++
win32build/check/exceptions-win32-all.bat | 6 +
win32build/check/exceptions-win32-all.sh | 4 +
win32build/check/exceptions-win32-debug.bat | 11 +
win32build/check/exceptions-win32-debug.sh | 7 +
win32build/check/exceptions-win32-release.bat | 11 +
win32build/check/exceptions-win32-release.sh | 7 +
win32build/check/exceptions-x64-all.bat | 6 +
win32build/check/exceptions-x64-all.sh | 4 +
win32build/check/exceptions-x64-debug.bat | 11 +
win32build/check/exceptions-x64-debug.sh | 7 +
win32build/check/exceptions-x64-release.bat | 11 +
win32build/check/exceptions-x64-release.sh | 7 +
win32build/check/win32-all.bat | 5 +
win32build/check/win32-all.sh | 3 +
win32build/check/win32-debug-all.bat | 5 +
win32build/check/win32-debug-all.sh | 3 +
win32build/check/win32-release-all.bat | 5 +
win32build/check/win32-release-all.sh | 3 +
win32build/check/x64-all.bat | 5 +
win32build/check/x64-all.sh | 3 +
win32build/check/x64-debug-all.bat | 5 +
win32build/check/x64-debug-all.sh | 3 +
win32build/check/x64-release-all.bat | 5 +
win32build/check/x64-release-all.sh | 3 +
win32build/config.h | 84 ++++
win32build/dllmain.cc | 18 +
win32build/env-win32-debug.bat | 22 +
win32build/env-win32-debug.sh | 16 +
win32build/env-win32-release.bat | 22 +
win32build/env-win32-release.sh | 16 +
win32build/env-x64-debug.bat | 22 +
win32build/env-x64-debug.sh | 16 +
win32build/env-x64-release.bat | 22 +
win32build/env-x64-release.sh | 16 +
win32build/getopt.cc | 79 +++
win32build/getopt.h | 4 +
win32build/getopt_long.cc | 523 ++++++++++++++++++++
win32build/getopt_long.h | 104 ++++
win32build/strptime.cc | 181 +++++++
win32build/strptime.h | 31 ++
60 files changed, 2389 insertions(+), 21 deletions(-)
create mode 100644 doc/version.ent.win32
copy src/{bin/resolver/common.h => lib/exceptions/dll.h} (68%)
create mode 100644 win32build/BINDInstall/BINDInstall.cpp
create mode 100644 win32build/BINDInstall/stdafx.cpp
create mode 100644 win32build/BINDInstall/stdafx.h
create mode 100644 win32build/BINDInstall/targetver.h
create mode 100755 win32build/VS/BINDInstall/BINDInstall.vcxproj
create mode 100755 win32build/VS/BINDInstall/BINDInstall.vcxproj.filters
create mode 100755 win32build/VS/BINDInstall/BINDInstall.vcxproj.user
create mode 100755 win32build/VS/bind10.sln
create mode 100755 win32build/VS/exceptions-tests/exceptions-tests.vcxproj
create mode 100755 win32build/VS/exceptions-tests/exceptions-tests.vcxproj.filters
create mode 100755 win32build/VS/exceptions-tests/exceptions-tests.vcxproj.user
create mode 100755 win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj
create mode 100755 win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.filters
create mode 100755 win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.user
create mode 100644 win32build/WIN32-NOTES
create mode 100755 win32build/check/exceptions-win32-all.bat
create mode 100755 win32build/check/exceptions-win32-all.sh
create mode 100755 win32build/check/exceptions-win32-debug.bat
create mode 100755 win32build/check/exceptions-win32-debug.sh
create mode 100755 win32build/check/exceptions-win32-release.bat
create mode 100755 win32build/check/exceptions-win32-release.sh
create mode 100755 win32build/check/exceptions-x64-all.bat
create mode 100755 win32build/check/exceptions-x64-all.sh
create mode 100755 win32build/check/exceptions-x64-debug.bat
create mode 100755 win32build/check/exceptions-x64-debug.sh
create mode 100755 win32build/check/exceptions-x64-release.bat
create mode 100755 win32build/check/exceptions-x64-release.sh
create mode 100755 win32build/check/win32-all.bat
create mode 100755 win32build/check/win32-all.sh
create mode 100755 win32build/check/win32-debug-all.bat
create mode 100755 win32build/check/win32-debug-all.sh
create mode 100755 win32build/check/win32-release-all.bat
create mode 100755 win32build/check/win32-release-all.sh
create mode 100755 win32build/check/x64-all.bat
create mode 100755 win32build/check/x64-all.sh
create mode 100755 win32build/check/x64-debug-all.bat
create mode 100755 win32build/check/x64-debug-all.sh
create mode 100755 win32build/check/x64-release-all.bat
create mode 100755 win32build/check/x64-release-all.sh
create mode 100644 win32build/config.h
create mode 100644 win32build/dllmain.cc
create mode 100755 win32build/env-win32-debug.bat
create mode 100755 win32build/env-win32-debug.sh
create mode 100755 win32build/env-win32-release.bat
create mode 100755 win32build/env-win32-release.sh
create mode 100755 win32build/env-x64-debug.bat
create mode 100755 win32build/env-x64-debug.sh
create mode 100755 win32build/env-x64-release.bat
create mode 100755 win32build/env-x64-release.sh
create mode 100644 win32build/getopt.cc
create mode 100644 win32build/getopt.h
create mode 100644 win32build/getopt_long.cc
create mode 100644 win32build/getopt_long.h
create mode 100644 win32build/strptime.cc
create mode 100644 win32build/strptime.h
-----------------------------------------------------------------------
diff --git a/doc/version.ent.win32 b/doc/version.ent.win32
new file mode 100644
index 0000000..15e07c6
--- /dev/null
+++ b/doc/version.ent.win32
@@ -0,0 +1 @@
+<!ENTITY __VERSION__ "20120817">
diff --git a/ext/coroutine/coroutine.h b/ext/coroutine/coroutine.h
index 985888b..4ddda48 100644
--- a/ext/coroutine/coroutine.h
+++ b/ext/coroutine/coroutine.h
@@ -104,11 +104,11 @@ private:
} \
else case 0:
-#define CORO_YIELD \
- for (_coro_value = __LINE__;;) \
+#define CORO_YIELD_IMPL(n) \
+ for (_coro_value = (n);;) \
if (_coro_value == 0) \
{ \
- case __LINE__: ; \
+ case (n): ; \
break; \
} \
else \
@@ -121,13 +121,22 @@ private:
goto bail_out_of_coroutine; \
else case 0:
-#define CORO_FORK \
- for (_coro_value = -__LINE__;; _coro_value = __LINE__) \
- if (_coro_value == __LINE__) \
+#define CORO_FORK_IMPL(n) \
+ for (_coro_value = -(n);; _coro_value = (n)) \
+ if (_coro_value == (n)) \
{ \
- case -__LINE__: ; \
+ case -(n): ; \
break; \
} \
else
+
+#if defined(_MSC_VER)
+# define CORO_YIELD CORO_YIELD_IMPL(__COUNTER__ + 1)
+# define CORO_FORK CORO_FORK_IMPL(__COUNTER__ + 1)
+#else // defined(_MSC_VER)
+# define CORO_YIELD CORO_YIELD_IMPL(__LINE__)
+# define CORO_FORK CORO_FORK_IMPL(__LINE__)
+#endif // defined(_MSC_VER)
+
#endif // COROUTINE_HPP
diff --git a/src/lib/exceptions/dll.h b/src/lib/exceptions/dll.h
new file mode 100644
index 0000000..be6ee83
--- /dev/null
+++ b/src/lib/exceptions/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBEXCEPTIONS_H
+#define __LIBEXCEPTIONS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBEXCEPTIONS_API
+#else
+#ifdef B10_LIBEXCEPTIONS_EXPORT
+#define B10_LIBEXCEPTIONS_API __declspec(dllexport)
+#else
+#define B10_LIBEXCEPTIONS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBEXCEPTIONS_H
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/exceptions/exceptions.cc b/src/lib/exceptions/exceptions.cc
index 2a374da..7bfc507 100644
--- a/src/lib/exceptions/exceptions.cc
+++ b/src/lib/exceptions/exceptions.cc
@@ -12,6 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#define B10_LIBEXCEPTIONS_EXPORT
+
#include <string>
#include <exceptions/exceptions.h>
diff --git a/src/lib/exceptions/exceptions.h b/src/lib/exceptions/exceptions.h
index 010fd39..2144582 100644
--- a/src/lib/exceptions/exceptions.h
+++ b/src/lib/exceptions/exceptions.h
@@ -19,6 +19,8 @@
#include <string>
#include <sstream>
+#include <exceptions/dll.h>
+
namespace isc {
///
@@ -28,7 +30,7 @@ namespace isc {
/// exception such as the file name and line number where the exception is
/// triggered.
///
-class Exception : public std::exception {
+class B10_LIBEXCEPTIONS_API Exception : public std::exception {
public:
///
/// \name Constructors and Destructor
@@ -103,7 +105,7 @@ private:
/// \brief A generic exception that is thrown if a parameter given
/// to a method would refer to or modify out-of-range data.
-class OutOfRange : public Exception {
+class B10_LIBEXCEPTIONS_API OutOfRange : public Exception {
public:
OutOfRange(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
@@ -112,7 +114,7 @@ public:
/// \brief A generic exception that is thrown if a parameter given
/// to a method or function is considered invalid and no other specific
/// exceptions are suitable to describe the error.
-class InvalidParameter : public Exception {
+class B10_LIBEXCEPTIONS_API InvalidParameter : public Exception {
public:
InvalidParameter(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
@@ -120,7 +122,7 @@ public:
/// \brief A generic exception that is thrown if a parameter given
/// to a method is considered invalid in that context.
-class BadValue : public Exception {
+class B10_LIBEXCEPTIONS_API BadValue : public Exception {
public:
BadValue(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
@@ -131,7 +133,7 @@ public:
///
/// For example, this can happen if a class method is called when the object's
/// state does not allow that particular method.
-class InvalidOperation : public Exception {
+class B10_LIBEXCEPTIONS_API InvalidOperation : public Exception {
public:
InvalidOperation(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
@@ -141,7 +143,7 @@ public:
/// \brief A generic exception that is thrown when an unexpected
/// error condition occurs.
///
-class Unexpected : public Exception {
+class B10_LIBEXCEPTIONS_API Unexpected : public Exception {
public:
Unexpected(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
@@ -153,7 +155,7 @@ public:
///
/// This may be due to unfinished implementation or in case the
/// function isn't even planned to be provided for that situation.
-class NotImplemented : public Exception {
+class B10_LIBEXCEPTIONS_API NotImplemented : public Exception {
public:
NotImplemented(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
@@ -180,36 +182,84 @@ public:
/// this is defined as a macro. The convenience for the ostream is a secondary
/// purpose (if that were the only possible reason we should rather avoid
/// using a macro).
+#ifdef _MSC_VER
+#define isc_throw(type, stream) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable: 4127)) \
+ do { \
+ std::ostringstream oss__; \
+ oss__ << stream; \
+ throw type(__FILE__, __LINE__, oss__.str().c_str()); \
+ } while (1) \
+ __pragma(warning(pop))
+#else
#define isc_throw(type, stream) \
do { \
std::ostringstream oss__; \
oss__ << stream; \
throw type(__FILE__, __LINE__, oss__.str().c_str()); \
} while (1)
+#endif
///
/// Similar as isc_throw, but allows the exception to have one additional
/// parameter (the stream/text goes first)
+#ifdef _MSC_VER
+#define isc_throw_1(type, stream, param1) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable: 4127)) \
+ do { \
+ std::ostringstream oss__; \
+ oss__ << stream; \
+ throw type(__FILE__, __LINE__, oss__.str().c_str(), param1); \
+ } while (1) \
+ __pragma(warning(pop))
+#else
#define isc_throw_1(type, stream, param1) \
do { \
std::ostringstream oss__; \
oss__ << stream; \
throw type(__FILE__, __LINE__, oss__.str().c_str(), param1); \
} while (1)
+#endif
///
/// Similar as isc_throw, but allows the exception to have two additional
/// parameters (the stream/text goes first)
+#ifdef _MSC_VER
+#define isc_throw_2(type, stream, param1, param2) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable: 4127)) \
+ do { \
+ std::ostringstream oss__; \
+ oss__ << stream; \
+ throw type(__FILE__, __LINE__, oss__.str().c_str(), param1, param2); \
+ } while (1) \
+ __pragma(warning(pop))
+#else
#define isc_throw_2(type, stream, param1, param2) \
do { \
std::ostringstream oss__; \
oss__ << stream; \
throw type(__FILE__, __LINE__, oss__.str().c_str(), param1, param2); \
} while (1)
+#endif
///
/// Similar as isc_throw, but allows the exception to have three additional
/// parameters (the stream/text goes first)
+#ifdef _MSC_VER
+#define isc_throw_3(type, stream, param1, param2, param3) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable: 4127)) \
+ do { \
+ std::ostringstream oss__; \
+ oss__ << stream; \
+ throw type(__FILE__, __LINE__, oss__.str().c_str(), param1, param2,\
+ param3); \
+ } while (1) \
+ __pragma(warning(pop))
+#else
#define isc_throw_3(type, stream, param1, param2, param3) \
do { \
std::ostringstream oss__; \
@@ -217,10 +267,23 @@ public:
throw type(__FILE__, __LINE__, oss__.str().c_str(), param1, param2,\
param3); \
} while (1)
+#endif
///
/// Similar as isc_throw, but allows the exception to have four additional
/// parameters (the stream/text goes first)
+#ifdef _MSC_VER
+#define isc_throw_4(type, stream, param1, param2, param3, param4) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable: 4127)) \
+ do { \
+ std::ostringstream oss__; \
+ oss__ << stream; \
+ throw type(__FILE__, __LINE__, oss__.str().c_str(), param1, param2,\
+ param3, param4); \
+ } while (1) \
+ __pragma(warning(pop))
+#else
#define isc_throw_4(type, stream, param1, param2, param3, param4) \
do { \
std::ostringstream oss__; \
@@ -228,6 +291,7 @@ public:
throw type(__FILE__, __LINE__, oss__.str().c_str(), param1, param2,\
param3, param4); \
} while (1)
+#endif
}
#endif // __EXCEPTIONS_H
diff --git a/win32build/BINDInstall/BINDInstall.cpp b/win32build/BINDInstall/BINDInstall.cpp
new file mode 100644
index 0000000..cbb562b
--- /dev/null
+++ b/win32build/BINDInstall/BINDInstall.cpp
@@ -0,0 +1,11 @@
+// BINDInstall.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ return 0;
+}
+
diff --git a/win32build/BINDInstall/stdafx.cpp b/win32build/BINDInstall/stdafx.cpp
new file mode 100644
index 0000000..4acff63
--- /dev/null
+++ b/win32build/BINDInstall/stdafx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// BINDInstall.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/win32build/BINDInstall/stdafx.h b/win32build/BINDInstall/stdafx.h
new file mode 100644
index 0000000..47a0d02
--- /dev/null
+++ b/win32build/BINDInstall/stdafx.h
@@ -0,0 +1,15 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#include <stdio.h>
+#include <tchar.h>
+
+
+
+// TODO: reference additional headers your program requires here
diff --git a/win32build/BINDInstall/targetver.h b/win32build/BINDInstall/targetver.h
new file mode 100644
index 0000000..90e767b
--- /dev/null
+++ b/win32build/BINDInstall/targetver.h
@@ -0,0 +1,8 @@
+#pragma once
+
+// Including SDKDDKVer.h defines the highest available Windows platform.
+
+// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
+// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
+
+#include <SDKDDKVer.h>
diff --git a/win32build/VS/BINDInstall/BINDInstall.vcxproj b/win32build/VS/BINDInstall/BINDInstall.vcxproj
new file mode 100755
index 0000000..924a07f
--- /dev/null
+++ b/win32build/VS/BINDInstall/BINDInstall.vcxproj
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{41B1A417-2276-422A-A054-2691F6E40A54}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>BINDInstall</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <CompileAs>CompileAsCpp</CompileAs>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <CompileAs>CompileAsCpp</CompileAs>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\BINDInstall\stdafx.h" />
+ <ClInclude Include="..\..\BINDInstall\targetver.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\BINDInstall\BINDInstall.cpp" />
+ <ClCompile Include="..\..\BINDInstall\stdafx.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/BINDInstall/BINDInstall.vcxproj.filters b/win32build/VS/BINDInstall/BINDInstall.vcxproj.filters
new file mode 100755
index 0000000..fee86cc
--- /dev/null
+++ b/win32build/VS/BINDInstall/BINDInstall.vcxproj.filters
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\BINDInstall\stdafx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\BINDInstall\targetver.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\BINDInstall\BINDInstall.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\BINDInstall\stdafx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/BINDInstall/BINDInstall.vcxproj.user b/win32build/VS/BINDInstall/BINDInstall.vcxproj.user
new file mode 100755
index 0000000..695b5c7
--- /dev/null
+++ b/win32build/VS/BINDInstall/BINDInstall.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/bind10.sln b/win32build/VS/bind10.sln
new file mode 100755
index 0000000..d7ba5b2
--- /dev/null
+++ b/win32build/VS/bind10.sln
@@ -0,0 +1,53 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BINDInstall", "BINDInstall\BINDInstall.vcxproj", "{41B1A417-2276-422A-A054-2691F6E40A54}"
+ ProjectSection(ProjectDependencies) = postProject
+ {7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2} = {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libb10-exceptions", "libb10-exceptions\libb10-exceptions.vcxproj", "{7D04222B-643C-446C-A2B8-93AF74A86246}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exceptions-tests", "exceptions-tests\exceptions-tests.vcxproj", "{DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}"
+ ProjectSection(ProjectDependencies) = postProject
+ {7D04222B-643C-446C-A2B8-93AF74A86246} = {7D04222B-643C-446C-A2B8-93AF74A86246}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Debug|Win32.ActiveCfg = Debug|Win32
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Debug|Win32.Build.0 = Debug|Win32
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Debug|x64.ActiveCfg = Debug|x64
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Debug|x64.Build.0 = Debug|x64
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Release|Win32.ActiveCfg = Release|Win32
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Release|Win32.Build.0 = Release|Win32
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Release|x64.ActiveCfg = Release|x64
+ {41B1A417-2276-422A-A054-2691F6E40A54}.Release|x64.Build.0 = Release|x64
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Debug|Win32.Build.0 = Debug|Win32
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Debug|x64.ActiveCfg = Debug|x64
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Debug|x64.Build.0 = Debug|x64
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Release|Win32.ActiveCfg = Release|Win32
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Release|Win32.Build.0 = Release|Win32
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Release|x64.ActiveCfg = Release|x64
+ {7D04222B-643C-446C-A2B8-93AF74A86246}.Release|x64.Build.0 = Release|x64
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Debug|Win32.Build.0 = Debug|Win32
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Debug|x64.ActiveCfg = Debug|x64
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Debug|x64.Build.0 = Debug|x64
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Release|Win32.ActiveCfg = Release|Win32
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Release|Win32.Build.0 = Release|Win32
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Release|x64.ActiveCfg = Release|x64
+ {DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/win32build/VS/exceptions-tests/exceptions-tests.vcxproj b/win32build/VS/exceptions-tests/exceptions-tests.vcxproj
new file mode 100755
index 0000000..e68583f
--- /dev/null
+++ b/win32build/VS/exceptions-tests/exceptions-tests.vcxproj
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{DCF4ED2E-FFD1-4432-AFEF-8D6EC96B79A2}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>exceptions-tests</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(Platform).$(Configuration)\</OutDir>
+ <TargetName>run_unittests</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>run_unittests</TargetName>
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(Platform).$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Platform).$(Configuration)\</OutDir>
+ <TargetName>run_unittests</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetName>run_unittests</TargetName>
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Platform).$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;GTEST_LINKED_AS_SHARED_LIBRARY=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\..\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;4275;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
+ <AdditionalDependencies>libb10-exceptions.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\$(Platform).$(Configuration);..\..\..\..\gtest\$(Platform).$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;GTEST_LINKED_AS_SHARED_LIBRARY=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\..\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;4275;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
+ <AdditionalDependencies>libb10-exceptions.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\$(Platform).$(Configuration);..\..\..\..\gtest\$(Platform).$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;GTEST_LINKED_AS_SHARED_LIBRARY=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\..\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;4275;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
+ <AdditionalDependencies>libb10-exceptions.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\$(Platform).$(Configuration);..\..\..\..\gtest\$(Platform).$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;GTEST_LINKED_AS_SHARED_LIBRARY=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;..\..\..\src\lib\dns;..\..\..\..\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;4275;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
+ <AdditionalDependencies>libb10-exceptions.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\$(Platform).$(Configuration);..\..\..\..\gtest\$(Platform).$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\lib\exceptions\tests\exceptions_unittest.cc" />
+ <ClCompile Include="..\..\..\src\lib\exceptions\tests\run_unittests.cc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/exceptions-tests/exceptions-tests.vcxproj.filters b/win32build/VS/exceptions-tests/exceptions-tests.vcxproj.filters
new file mode 100755
index 0000000..5257163
--- /dev/null
+++ b/win32build/VS/exceptions-tests/exceptions-tests.vcxproj.filters
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\lib\exceptions\tests\exceptions_unittest.cc">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\lib\exceptions\tests\run_unittests.cc">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/exceptions-tests/exceptions-tests.vcxproj.user b/win32build/VS/exceptions-tests/exceptions-tests.vcxproj.user
new file mode 100755
index 0000000..695b5c7
--- /dev/null
+++ b/win32build/VS/exceptions-tests/exceptions-tests.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj b/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj
new file mode 100755
index 0000000..6fa55dc
--- /dev/null
+++ b/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\src\lib\exceptions\dll.h" />
+ <ClInclude Include="..\..\..\src\lib\exceptions\exceptions.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\lib\exceptions\exceptions.cc" />
+ <ClCompile Include="..\..\dllmain.cc" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{7D04222B-643C-446C-A2B8-93AF74A86246}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>libb10-exceptions</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ <OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>$(ProjectName)</TargetName>
+ <OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)\$(Platform).$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <PostBuildEvent>
+ <Command>cd ..\..\..\doc
+copy version.ent.win32 version.ent
+
+cd %BIND10PREFIX%
+mkdir var\bind10-devel
+mkdir share\bind10-devel
+mkdir etc\bind10-devel
+
+exit /b 0
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <PostBuildEvent>
+ <Command>cd ..\..\..\doc
+copy version.ent.win32 version.ent
+
+cd %BIND10PREFIX%
+mkdir var\bind10-devel
+mkdir share\bind10-devel
+mkdir etc\bind10-devel
+
+exit /b 0
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PostBuildEvent>
+ <Command>cd ..\..\..\doc
+copy version.ent.win32 version.ent
+
+cd %BIND10PREFIX%
+mkdir var\bind10-devel
+mkdir share\bind10-devel
+mkdir etc\bind10-devel
+
+exit /b 0
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..;..\..\..\src\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4251;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PostBuildEvent>
+ <Command>cd ..\..\..\doc
+copy version.ent.win32 version.ent
+
+cd %BIND10PREFIX%
+mkdir var\bind10-devel
+mkdir share\bind10-devel
+mkdir etc\bind10-devel
+
+exit /b 0
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.filters b/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.filters
new file mode 100755
index 0000000..9b65aca
--- /dev/null
+++ b/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.filters
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\src\lib\exceptions\dll.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\lib\exceptions\exceptions.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\lib\exceptions\exceptions.cc">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\dllmain.cc">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.user b/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.user
new file mode 100755
index 0000000..695b5c7
--- /dev/null
+++ b/win32build/VS/libb10-exceptions/libb10-exceptions.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file
diff --git a/win32build/WIN32-NOTES b/win32build/WIN32-NOTES
new file mode 100644
index 0000000..24897a1
--- /dev/null
+++ b/win32build/WIN32-NOTES
@@ -0,0 +1,303 @@
+What is needed:
+
+ - full IPv6 support (so at least Vista or Server 2008,
+ tested on Server 2008 x86 and Windows 7 x86_64)
+
+ - POSIX (aka Unix) environment for tar/git/...
+ (I use and recommend cygwin)
+
+ - Visual Studio C++ (versions 2008 and 2010 were tested,
+ (note older versions could fail to correctly compile,
+ cf. C4373 warning), 2010 express and 64 bit support
+ from the 7.1 SDK work too. VS 2012 support was added.)
+ Today the solution is for VS 2010 and can be upgraded to
+ VS 2012, both including the Express free version.
+ Note parallel build is not supported, i.e., Tools Option -
+ Projects and Solution - Build and Run - maximum number of
+ parallel project builds should be set to 1
+
+ - python >= 3.1 (I got Cpython 3.2 MSI from python.org,
+ note the pre-built python can give C++ runtime issue with
+ an incompatible Visual Studio, and botan wants a version 2
+ for configuration. Current python has no socket.inet_ntop /
+ socket.inet_pton or _d.lib, so I recommend to compile it)
+
+ - perl (the Windows native one)
+
+ - sqlite3 >= 3.3.9 (got the 3.7.6 prebuilds but the distrib
+ is needed to get/build the .h and .lib file) (note for the second
+ 'lib /def:C:\path\to\sqlite3.def /out:C:\path\to\sqlite3.lib /machine:x86'
+ gives the file if not in the distrib or has a _ mismatch).
+ Needs the shell too, but the debug library is not really required
+ (i.e., it is optional to compile it)
+
+ - splite3 python DSO (included in the Python MSI and built when compiled)
+
+ - cmakefile (got the 2.8.4 .exe, can be used but see below)
+
+ - google test (aka gtest, got the 1.[56].0 sources but some recent
+ tests require >= 1.6.0)
+
+ - boost >= 1.35 (got the 1.44/1.47 setup from Boostpro, installed
+ Multithread and Multithread Debug, compile 1.51.0)
+
+ - setproctitle python module (in theory, consider to download
+ the Sysinternals suite with it)
+
+ - botan 1.10.x (compiled from sources to control things, i.e.,
+ tried to factorize the (in)convenience with gtest. Note its
+ config phase requires a python2. Tested with a 1.10.x too)
+
+ - log4cplus (compiled from sources in the same style...
+ Note WIN32 disables syslog support)
+
+ - xsltproc, for instance from http://www.zlatkovic.com/libxml.en.html,
+ or the Cygwin one, if you want to generate man files from xml.
+
+Environment variables (with examples, *please* note the separator):
+
+ - BOOST ->
+ C:\Program Files (x86)\boost\boost_1_47
+ C:\Boost\boost-1_51
+
+ - PYTHONDIR -> C:\Python32
+
+ - PYTHONVER -> 33
+
+ - BIND10HOME ->
+ c:/cygwin/home/dupont/bind10
+ c:/cygwin/home/fdupont/dev/bind10-trac2117
+
+ - BIND10PREFIX -> c:/Temp
+
+ - VSCNF -> unset or release (default) or debug
+
+ - VSPLT -> unset or win32 (default) or x64 (or TODO ...)
+
+ - BIND10_MSGQ_SOCKET (todo)
+
+How to compile google test:
+
+ - remove the /MD -> /MT line in the CMakeLists.txt, use cmake
+ (in theory but it doesn't work for me)
+
+ - *or* open the solution gtest[-md] in msvc (please note the rights
+ of files in this directory must be fixed before)
+
+ - change the project to build a DLL, define GTEST_CREATE_SHARED_LIBRARY
+ to 1 for DLLs (cf. the README), GTEST_LINKED_AS_SHARED_LIBRARY for apps,
+ put /W4 for Debug, add gtest.lib and gtest-md in linker for apps, etc
+
+ - please remember the same Visual Studio version must be used
+ for gtest and bind10
+
+ - msvc gives the gtestd.dll (in place of gtest.dll) for the debug version
+ so you have to fix this. IMHO the simplest is to put the right name files
+ as targets.
+
+ - with Visual Studio 2012 define _VARIADIC_MAX=10 each time gtest.h is
+ included
+
+How to compile botan:
+
+ - works well with a (second) Python in version 2.x installed
+
+ - reconfig the Debug (--enable-debug) Makefile to produce a botan.{dll,lib}
+
+ - Visual Studio 2012 changed the type of std::make_pair so it should be
+ no longer called with template arguments (i.e., <x,y>) but assigns a
+ a value of std::pair<x,y> type
+
+How to compile sqlite3:
+
+ - get the amalgamation file and the dll distrib for the .def
+
+ - compile sqlite3.c with SQLITE_ENABLE_COLUMN_METADATA and
+ SQLITE_ENABLE_RTREE flags
+
+How to compile python:
+
+ - install sqlite3 before (sqlite3 project needs 3 sqlite source files)
+
+ - solution file is in PCbuild/pcbuild.sln
+
+ - patch PC/pyconfig.h with a recent OS for Py_WINVER (BTW Win7 is 0x601)
+ and Py_NTDDI
+
+ - patch Modules/socketmodule.h with:
+
+#else /* MS_WINDOWS */
+# include <winsock2.h>
+# include <ws2tcpip.h>
+# undef CMSG_LEN
+/* VC6 is shipped with old platform headers, and does not have MSTcpIP.h
+ * Separate SDKs have all the functions we want, but older ones don't have
+ * any version information.
+ * I use SIO_GET_MULTICAST_FILTER to detect a decent SDK.
+ */
+# ifdef SIO_GET_MULTICAST_FILTER
+# include <MSTcpIP.h> /* for SIO_RCVALL */
+# define HAVE_ADDRINFO
+# define HAVE_SOCKADDR_STORAGE
+# define HAVE_GETADDRINFO
+# define HAVE_GETNAMEINFO
+# define HAVE_INET_NTOP
+# define HAVE_INET_PTON
+# define ENABLE_IPV6
+# else
+
+ - on Visual Studio 2012, optionaly update Tools/buildbot/build.bat
+ (but buildbots don't work for me)
+
+ - install with a layout similar to C:\Python2*
+
+How to compile log4cplus:
+
+ - use the Visual Studio solution file in msvc* directory
+ (not yet analyze what to do with project directory for Express)
+
+ - when got an error on std::bind1st, add #include <functional>
+
+ - remove the D for debug library (the Release/Debug switch is
+ controlled by the PATH, not by an alternate name) for the .dll
+ and the .lib in the Project file
+
+How to compile boost:
+
+ - *optional*
+
+ - consider --build-type=complete for .\b2
+
+ - x64 is set by address-model=64
+
+ - result should be *.hpp files under ${BOOST}/boost and *.lib files
+ under ${BOOST}/lib with -mt and -mt-gd variants
+
+Where to put things:
+
+ - <home>\bind10 for bind10 (BIND10HOME environment variable)
+
+ - <home>\gtest\include
+
+ - <home>\gtest\{Win32,x64}.{Debug,Release}\gtest.{dll,lib} and vc*0.*
+
+ - <home>\botan\include
+
+ - <home>\botan\{Win32,x64}.{Debug,Release}\botan.{dll,lib}
+
+ - <home>\sqlite3\include\sqlite3*.h
+
+ - <home>\sqlite3\{Win32,x64}.{Debug,Release}\sqlite3.{dll,lib} and vc1*0.*
+
+ - <home>\sqlite3\{Win32,x64}\bin\sqlite3.exe (aka sqlite3 shell)
+
+ - <home>\log4cplus\include
+
+ - <home>\log4cplus\{Win32,x64}.{Debug,Release}\log4cplus.{dll,lib}
+
+ - ${BOOST}/boost and ${BOOST}/lib (called by auto_link)
+
+ - ${PYTHONDIR} with python${PYTHONVER}{,_d}.{dll,lib} in ${PYTHONDIR}
+ (if you want copy the python3*.dll in a place in the PATH,
+ on Window7 64 bits it is SysWOW64 in place of System32 but it works
+ too by putting the directory of the DLL in the PATH. And of course
+ python.exe should be in the PATH too...
+
+How to compile:
+
+ - open win32build\VS\bind10.sln file with Visual Studio
+
+ - set the platform (Win32 (default) or x64)
+
+ - when needed fix the paths (\ becomes \\\ in grep/ed/etc)
+
+ - build
+
+ - partial or todo directory ports are marked
+
+Scripts:
+
+ - win32build\env*.{sh,bat} cygwin shell or Windows command scripts
+ to set the corresponding environment
+
+ - win32build\check\*.{sh,bat} cygwin shell or Windows command scripts
+ for automatic testings (aka "make check")
+
+Random notes (for porting new code):
+ - getopt() is *not* standard (got working getopt.{h,cc})
+ - inet_pton() requires >= Vista/2008
+ - forget lcov/pycoverage
+ - cmake?
+
+ - ifdefs: _WIN32 and _MSC_VER
+ - *no* <unistd.h> (or network includes)
+ - <sys/time.h> -> <time.h> alternative
+ - missing general defines -> include <config.h> in front
+ - missing less general defines -> conditionally include <winsock2.h>
+ - missing TCP/IP defines -> conditionally include <ws2tcpip.h>
+ and perhaps <mswsock> too *before* asio (SIO_UDP_CONNRESET,
+ a Microsoft extension, is in mswsock for instance)
+ - integer posix types -> include <stdint.h> (or <cstdint>)
+ - assignment with contants: standard private C4512 declaration
+ (to be revised into derived from notassignable)
+ - reuse_address is different in Windows
+ - missing namespace:
+ * error_code -> asio::error_code (both type and function)
+ * shared_ptr -> boost::shared_ptr
+ (all should be fixed now)
+ - *no* PF_UNIX (aka asio::local) sockets
+ - *no* fork() (but can use threads)
+ - unused variable in catch: simply remove it
+ - sleep() or nanosleep() -> Sleep()
+ - gettimeofday() -> GetSystemTimeAsFileTime() - SystemTimeToFileTime(epoch)
+ - underscored function names: _getid, _read, _write (caution: convert
+ the file handle before, for sockets WSAXxx calls),
+ - defined misc names: IN, ERROR, NOERROR (done in config.h but used
+ in other system includes... undefining UNICODE can help too)
+ - different names: close -> closesocket (and error is INVALID_SOCKET
+ not < 0), errno -> WSAGetLastError()
+ (can use the asio socket_type too?)
+ - different declarations: send, recv, ...
+ - WSAStartup/WSACleanup in main()
+
+DLL specific:
+ - add dllmain.cc (it doesn't seem to be required anyway?)
+ - standard declaration trick in dll.h, included in all headers
+ - ISC_XXX_API for exported classes in headers, exported functions
+ and data (usually with extern for data) in headers and code files
+ (note it is possible to decorate only needed members/ctors/dtors,
+ and required in a few cases)
+ - ISC_XXX_EXPORT at the top of all code files
+ - nothing for the templates, already done for Python modules
+ - can be required to instantiate classes (cf. util/buffer.cc)
+ - DLLs should go to .../win32build/VSxxxx/{Release,Debug}
+ (greatly simplify the PATH environment variable, BTW settable on the
+ Computer property, Advanced stuff)
+ - Release and Debug DLLs MUST get different names (put a final 'd' on
+ Debug) or the system runtime will select the wrong DLL!
+ - define GTEST_LINKED_AS_SHARED_LIBRARY=1 for gtest DLL users
+
+Variable substitutions (aka @XXX@ -> YYY):
+ abs_builddir -> ${BIND10HOME}/<relative path>
+ abs_srcdir == abs_builddir
+ abs_top_builddir -> $BIND10HOME or its Cygwin value
+ abs_top_srcdir == abs_top_builddir
+ datadir -> ${datarootdir}
+ datarootdir -> ${prefix}/share
+ exec_prefix -> ${prefix}
+ libexecdir -> ${exec_prefix}
+ localstatedir -> ${prefix}/var
+ prefix -> $BIND10PREFIX aka /Temp (was /usr/local)
+ sysconfdir -> ${prefix}/etc
+ LOCALSTATEDIR -> ${prefix}/var (aka /Temp/var)
+ PACKAGE -> bind10-devel
+ PACKAGE_NAME == PACKAGE
+ PACKAGE_VERSION -> date '+%Y%m%d' from configure.ac AC_INIT(), here 20120817
+ PYTHON -> /usr/bin/python (ignored in #!)
+ PYTHONPATH -> real $PYTHONPATH env variable (unneeded in sys.path.append)
+ SYSCONFDIR -> ${sysconfdir} (aka /Temp/etc)
+
+require in $BIND10PREFIX:
+ ${BIND10PREFIX}/var ${BIND10PREFIX}/var/bind10-devel
+ ${BIND10PREFIX}/share ${BIND10PREFIX}/share/bind10-devel
+ ${BIND10PREFIX}/etc
diff --git a/win32build/check/exceptions-win32-all.bat b/win32build/check/exceptions-win32-all.bat
new file mode 100755
index 0000000..e09ca2b
--- /dev/null
+++ b/win32build/check/exceptions-win32-all.bat
@@ -0,0 +1,6 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-win32-release.bat && ^
+call .\win32build\check\exceptions-win32-debug.bat
+popd
diff --git a/win32build/check/exceptions-win32-all.sh b/win32build/check/exceptions-win32-all.sh
new file mode 100755
index 0000000..097d118
--- /dev/null
+++ b/win32build/check/exceptions-win32-all.sh
@@ -0,0 +1,4 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-win32-release.sh && \
+./win32build/check/exceptions-win32-debug.sh
+popd > /dev/null
diff --git a/win32build/check/exceptions-win32-debug.bat b/win32build/check/exceptions-win32-debug.bat
new file mode 100755
index 0000000..3e8c78c
--- /dev/null
+++ b/win32build/check/exceptions-win32-debug.bat
@@ -0,0 +1,11 @@
+ at echo off
+setlocal
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\env-win32-debug.bat
+echo:
+echo exceptions-tests / Win32.Debug
+echo:
+.\win32build\VS\exceptions-tests\Win32.Debug\run_unittests.exe
+popd
+endlocal
diff --git a/win32build/check/exceptions-win32-debug.sh b/win32build/check/exceptions-win32-debug.sh
new file mode 100755
index 0000000..6eacfa9
--- /dev/null
+++ b/win32build/check/exceptions-win32-debug.sh
@@ -0,0 +1,7 @@
+pushd ${BIND10HOME} > /dev/null
+. ./win32build/env-win32-debug.sh
+echo
+echo exceptions-tests / Win32.Debug
+echo
+./win32build/VS/exceptions-tests/Win32.Debug/run_unittests.exe
+popd > /dev/null
diff --git a/win32build/check/exceptions-win32-release.bat b/win32build/check/exceptions-win32-release.bat
new file mode 100755
index 0000000..f834049
--- /dev/null
+++ b/win32build/check/exceptions-win32-release.bat
@@ -0,0 +1,11 @@
+ at echo off
+setlocal
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\env-win32-release.bat
+echo:
+echo exceptions-tests / Win32.Release
+echo:
+.\win32build\VS\exceptions-tests\Win32.Release\run_unittests.exe
+popd
+endlocal
diff --git a/win32build/check/exceptions-win32-release.sh b/win32build/check/exceptions-win32-release.sh
new file mode 100755
index 0000000..e62ae91
--- /dev/null
+++ b/win32build/check/exceptions-win32-release.sh
@@ -0,0 +1,7 @@
+pushd ${BIND10HOME} > /dev/null
+. ./win32build/env-win32-release.sh
+echo
+echo exceptions-tests / Win32.Release
+echo
+./win32build/VS/exceptions-tests/Win32.Release/run_unittests.exe
+popd > /dev/null
diff --git a/win32build/check/exceptions-x64-all.bat b/win32build/check/exceptions-x64-all.bat
new file mode 100755
index 0000000..06758a3
--- /dev/null
+++ b/win32build/check/exceptions-x64-all.bat
@@ -0,0 +1,6 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-x64-release.bat && ^
+call .\win32build\check\exceptions-x64-debug.bat
+popd
diff --git a/win32build/check/exceptions-x64-all.sh b/win32build/check/exceptions-x64-all.sh
new file mode 100755
index 0000000..8dbf82e
--- /dev/null
+++ b/win32build/check/exceptions-x64-all.sh
@@ -0,0 +1,4 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-x64-release.sh && \
+./win32build/check/exceptions-x64-debug.sh
+popd > /dev/null
diff --git a/win32build/check/exceptions-x64-debug.bat b/win32build/check/exceptions-x64-debug.bat
new file mode 100755
index 0000000..22f7650
--- /dev/null
+++ b/win32build/check/exceptions-x64-debug.bat
@@ -0,0 +1,11 @@
+ at echo off
+setlocal
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\env-x64-debug.bat
+echo:
+echo exceptions-tests / x64.Debug
+echo:
+.\win32build\VS\exceptions-tests\x64.Debug\run_unittests.exe
+popd
+endlocal
diff --git a/win32build/check/exceptions-x64-debug.sh b/win32build/check/exceptions-x64-debug.sh
new file mode 100755
index 0000000..a45ff97
--- /dev/null
+++ b/win32build/check/exceptions-x64-debug.sh
@@ -0,0 +1,7 @@
+pushd ${BIND10HOME} > /dev/null
+. ./win32build/env-x64-debug.sh
+echo
+echo exceptions-tests / x64.Debug
+echo
+./win32build/VS/exceptions-tests/x64.Debug/run_unittests.exe
+popd > /dev/null
diff --git a/win32build/check/exceptions-x64-release.bat b/win32build/check/exceptions-x64-release.bat
new file mode 100755
index 0000000..1320d31
--- /dev/null
+++ b/win32build/check/exceptions-x64-release.bat
@@ -0,0 +1,11 @@
+ at echo off
+setlocal
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\env-x64-release.bat
+echo:
+echo exceptions-tests / x64.Release
+echo:
+.\win32build\VS\exceptions-tests\x64.Release\run_unittests.exe
+popd
+endlocal
diff --git a/win32build/check/exceptions-x64-release.sh b/win32build/check/exceptions-x64-release.sh
new file mode 100755
index 0000000..cb32a75
--- /dev/null
+++ b/win32build/check/exceptions-x64-release.sh
@@ -0,0 +1,7 @@
+pushd ${BIND10HOME} > /dev/null
+. ./win32build/env-x64-release.sh
+echo
+echo exceptions-tests / x64.Release
+echo
+./win32build/VS/exceptions-tests/x64.Release/run_unittests.exe
+popd > /dev/null
diff --git a/win32build/check/win32-all.bat b/win32build/check/win32-all.bat
new file mode 100755
index 0000000..b19a9e4
--- /dev/null
+++ b/win32build/check/win32-all.bat
@@ -0,0 +1,5 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-win32-all.bat
+popd
diff --git a/win32build/check/win32-all.sh b/win32build/check/win32-all.sh
new file mode 100755
index 0000000..cbba7dd
--- /dev/null
+++ b/win32build/check/win32-all.sh
@@ -0,0 +1,3 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-win32-all.sh
+popd > /dev/null
diff --git a/win32build/check/win32-debug-all.bat b/win32build/check/win32-debug-all.bat
new file mode 100755
index 0000000..f50ef43
--- /dev/null
+++ b/win32build/check/win32-debug-all.bat
@@ -0,0 +1,5 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-win32-debug.bat
+popd
diff --git a/win32build/check/win32-debug-all.sh b/win32build/check/win32-debug-all.sh
new file mode 100755
index 0000000..0e3a709
--- /dev/null
+++ b/win32build/check/win32-debug-all.sh
@@ -0,0 +1,3 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-win32-debug.sh
+popd > /dev/null
diff --git a/win32build/check/win32-release-all.bat b/win32build/check/win32-release-all.bat
new file mode 100755
index 0000000..c7c5896
--- /dev/null
+++ b/win32build/check/win32-release-all.bat
@@ -0,0 +1,5 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-win32-release.bat
+popd
diff --git a/win32build/check/win32-release-all.sh b/win32build/check/win32-release-all.sh
new file mode 100755
index 0000000..a9f1997
--- /dev/null
+++ b/win32build/check/win32-release-all.sh
@@ -0,0 +1,3 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-win32-release.sh
+popd > /dev/null
diff --git a/win32build/check/x64-all.bat b/win32build/check/x64-all.bat
new file mode 100755
index 0000000..aaa05fb
--- /dev/null
+++ b/win32build/check/x64-all.bat
@@ -0,0 +1,5 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-x64-all.bat
+popd
diff --git a/win32build/check/x64-all.sh b/win32build/check/x64-all.sh
new file mode 100755
index 0000000..b4d4aab
--- /dev/null
+++ b/win32build/check/x64-all.sh
@@ -0,0 +1,3 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-x64-all.sh
+popd > /dev/null
diff --git a/win32build/check/x64-debug-all.bat b/win32build/check/x64-debug-all.bat
new file mode 100755
index 0000000..6028358
--- /dev/null
+++ b/win32build/check/x64-debug-all.bat
@@ -0,0 +1,5 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-x64-debug.bat
+popd
diff --git a/win32build/check/x64-debug-all.sh b/win32build/check/x64-debug-all.sh
new file mode 100755
index 0000000..720f187
--- /dev/null
+++ b/win32build/check/x64-debug-all.sh
@@ -0,0 +1,3 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-x64-debug.sh
+popd > /dev/null
diff --git a/win32build/check/x64-release-all.bat b/win32build/check/x64-release-all.bat
new file mode 100755
index 0000000..6521531
--- /dev/null
+++ b/win32build/check/x64-release-all.bat
@@ -0,0 +1,5 @@
+ at echo off
+pushd %CD%
+cd %BIND10HOME%
+call .\win32build\check\exceptions-x64-release.bat
+popd
diff --git a/win32build/check/x64-release-all.sh b/win32build/check/x64-release-all.sh
new file mode 100755
index 0000000..e6e7b10
--- /dev/null
+++ b/win32build/check/x64-release-all.sh
@@ -0,0 +1,3 @@
+pushd ${BIND10HOME} > /dev/null
+./win32build/check/exceptions-x64-release.sh
+popd > /dev/null
diff --git a/win32build/config.h b/win32build/config.h
new file mode 100644
index 0000000..5114f53
--- /dev/null
+++ b/win32build/config.h
@@ -0,0 +1,84 @@
+/* config.h for WIN32 */
+
+/* Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and
+ sun_len */
+/* #undef HAVE_SA_LEN */
+
+/* Need boost sunstudio workaround */
+/* #undef NEED_SUNPRO_WORKAROUND */
+
+/* Name of package */
+#define PACKAGE "bind10-devel"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bind10-dev at isc.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "bind10-devel"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "bind10-devel 20110322"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "bind10-devel"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "20110322"
+
+/* Use boost threads */
+/* #undef USE_BOOST_THREADS */
+
+/* Version number of package */
+#define VERSION "20110322"
+
+/* Additional things */
+
+/* At least Vista */
+
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+#endif
+
+/* WIN32 specials */
+
+#define srandom srand
+#define random() rand()
+typedef int pid_t;
+typedef unsigned int uid_t;
+#ifdef _WIN64
+typedef __int64 ssize_t;
+#else
+typedef int ssize_t;
+#endif
+
+/* Prevent the definition of min() and max() macros */
+#define NOMINMAX 1
+
+/* Prevent inclusion of winsock.h in windows.h */
+#define WIN32_LEAN_AND_MEAN 1
+/*
+ * Make the number of available sockets large
+ * The number of sockets needed can get large and memory's cheap
+ * This must be defined before winsock2.h gets included as the
+ * macro is used there.
+ */
+
+#define FD_SETSIZE 16384
+#include <windows.h>
+
+/* #pragma warning(disable: 4512) */
+
+#ifdef ERROR
+#undef ERROR
+#endif
+
+#ifdef NOERROR
+#undef NOERROR
+#endif
+
+#ifdef UNICODE
+#undef UNICODE
+#endif
diff --git a/win32build/dllmain.cc b/win32build/dllmain.cc
new file mode 100644
index 0000000..359227d
--- /dev/null
+++ b/win32build/dllmain.cc
@@ -0,0 +1,18 @@
+#include <windows.h>
+
+__declspec(dllexport) BOOL WINAPI
+DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpvReserved)
+{
+ hModule = hModule;
+ lpvReserved = lpvReserved;
+
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ default:
+ break;
+ }
+ return (TRUE);
+}
diff --git a/win32build/env-win32-debug.bat b/win32build/env-win32-debug.bat
new file mode 100755
index 0000000..14ec0e4
--- /dev/null
+++ b/win32build/env-win32-debug.bat
@@ -0,0 +1,22 @@
+ at rem Setting environment for BIND10 - Win32.Debug
+
+ at echo off
+
+pushd %CD%
+cd %BIND10HOME%
+set b10home=%CD%
+cd ..
+set b10parent=%CD%
+popd
+
+set B10_FROM_BUILD=%BIND10HOME%
+set PATH=%PATH%;%PYTHONDIR%
+set PATH=%PATH%;%b10parent%\gtest\Win32.Debug
+set PATH=%PATH%;%b10parent%\botan\Win32.Debug
+set PATH=%PATH%;%b10parent%\log4cplus\Win32.Debug
+set PATH=%PATH%;%b10parent%\sqlite3\Win32.Debug
+set PATH=%PATH%;%b10home%\win32build\VS\Win32.Debug
+set PYTHONPATH=%PYTHONPATH%;%b10home%\win32build\VS\Win32.Debug
+set PYTHONPATH=%PYTHONPATH%;%b10home%\src\lib\python\isc\util
+set PYTHON=%PYTHONDIR%\python_d.exe
+set BIND10_PATH=%BIND10HOME%/src/bin/bind10
diff --git a/win32build/env-win32-debug.sh b/win32build/env-win32-debug.sh
new file mode 100755
index 0000000..27db47f
--- /dev/null
+++ b/win32build/env-win32-debug.sh
@@ -0,0 +1,16 @@
+# Setting environment for BIND10 - Win32.Debug
+
+export B10_FROM_BUILD=${BIND10HOME}
+parent=`cygpath ${BIND10HOME}/..`
+b10home=`cygpath ${BIND10HOME}`
+pydir=`cygpath ${PYTHONDIR}`
+export PATH="${PATH}:${pydir}"
+export PATH="${PATH}:${parent}gtest/Win32.Debug"
+export PATH="${PATH}:${parent}botan/Win32.Debug"
+export PATH="${PATH}:${parent}log4cplus/Win32.Debug"
+export PATH="${PATH}:${parent}sqlite3/Win32.Debug"
+export PATH="${PATH}:${b10home}/win32build/VS/Win32.Debug"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/win32build/VS/Win32.Debug"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/src/lib/python/isc/util"
+export PYTHON=${pydir}/python_d.exe
+export BIND10_PATH=${BIND10HOME}/src/bin/bind10
diff --git a/win32build/env-win32-release.bat b/win32build/env-win32-release.bat
new file mode 100755
index 0000000..56ba1c5
--- /dev/null
+++ b/win32build/env-win32-release.bat
@@ -0,0 +1,22 @@
+ at rem Setting environment for BIND10 - Win32.Release
+
+ at echo off
+
+pushd %CD%
+cd %BIND10HOME%
+set b10home=%CD%
+cd ..
+set b10parent=%CD%
+popd
+
+set B10_FROM_BUILD=%BIND10HOME%
+set PATH=%PATH%;%PYTHONDIR%
+set PATH=%PATH%;%b10parent%\gtest\Win32.Release
+set PATH=%PATH%;%b10parent%\botan\Win32.Release
+set PATH=%PATH%;%b10parent%\log4cplus\Win32.Release
+set PATH=%PATH%;%b10parent%\sqlite3\Win32.Release
+set PATH=%PATH%;%b10home%\win32build\VS\Win32.Release
+set PYTHONPATH=%PYTHONPATH%;%b10home%\win32build\VS\Win32.Release
+set PYTHONPATH=%PYTHONPATH%;%b10home%\src\lib\python\isc\util
+set PYTHON=%PYTHONDIR%\python.exe
+set BIND10_PATH=%BIND10HOME%/src/bin/bind10
diff --git a/win32build/env-win32-release.sh b/win32build/env-win32-release.sh
new file mode 100755
index 0000000..08f0e5c
--- /dev/null
+++ b/win32build/env-win32-release.sh
@@ -0,0 +1,16 @@
+# Setting environment for BIND10 - Win32.Release
+
+export B10_FROM_BUILD=${BIND10HOME}
+parent=`cygpath ${BIND10HOME}/..`
+b10home=`cygpath ${BIND10HOME}`
+pydir=`cygpath ${PYTHONDIR}`
+export PATH="${PATH}:${pydir}"
+export PATH="${PATH}:${parent}gtest/Win32.Release"
+export PATH="${PATH}:${parent}botan/Win32.Release"
+export PATH="${PATH}:${parent}log4cplus/Win32.Release"
+export PATH="${PATH}:${parent}sqlite3/Win32.Release"
+export PATH="${PATH}:${b10home}/win32build/VS/Win32.Release"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/win32build/VS/Win32.Release"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/src/lib/python/isc/util"
+export PYTHON=${pydir}/python.exe
+export BIND10_PATH=${BIND10HOME}/src/bin/bind10
diff --git a/win32build/env-x64-debug.bat b/win32build/env-x64-debug.bat
new file mode 100755
index 0000000..88bedb2
--- /dev/null
+++ b/win32build/env-x64-debug.bat
@@ -0,0 +1,22 @@
+ at rem Setting environment for BIND10 - x64.Debug
+
+ at echo off
+
+pushd %CD%
+cd %BIND10HOME%
+set b10home=%CD%
+cd ..
+set b10parent=%CD%
+popd
+
+set B10_FROM_BUILD=%BIND10HOME%
+set PATH=%PATH%;%PYTHONDIR%
+set PATH=%PATH%;%b10parent%\gtest\x64.Debug
+set PATH=%PATH%;%b10parent%\botan\x64.Debug
+set PATH=%PATH%;%b10parent%\log4cplus\x64.Debug
+set PATH=%PATH%;%b10parent%\sqlite3\x64.Debug
+set PATH=%PATH%;%b10home%\win32build\VS\x64.Debug
+set PYTHONPATH=%PYTHONPATH%;%b10home%\win32build\VS\x64.Debug
+set PYTHONPATH=%PYTHONPATH%;%b10home%\src\lib\python\isc\util
+set PYTHON=%PYTHONDIR%\python_d.exe
+set BIND10_PATH=%BIND10HOME%/src/bin/bind10
diff --git a/win32build/env-x64-debug.sh b/win32build/env-x64-debug.sh
new file mode 100755
index 0000000..8baf15e
--- /dev/null
+++ b/win32build/env-x64-debug.sh
@@ -0,0 +1,16 @@
+# Setting environment for BIND10 - x64.Debug
+
+export B10_FROM_BUILD=${BIND10HOME}
+parent=`cygpath ${BIND10HOME}/..`
+b10home=`cygpath ${BIND10HOME}`
+pydir=`cygpath ${PYTHONDIR}`
+export PATH="${PATH}:${pydir}"
+export PATH="${PATH}:${parent}gtest/x64.Debug"
+export PATH="${PATH}:${parent}botan/x64.Debug"
+export PATH="${PATH}:${parent}log4cplus/x64.Debug"
+export PATH="${PATH}:${parent}sqlite3/x64.Debug"
+export PATH="${PATH}:${b10home}/win32build/VS/x64.Debug"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/win32build/VS/x64.Debug"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/src/lib/python/isc/util"
+export PYTHON=${pydir}/python_d.exe
+export BIND10_PATH=${BIND10HOME}/src/bin/bind10
diff --git a/win32build/env-x64-release.bat b/win32build/env-x64-release.bat
new file mode 100755
index 0000000..e6713e9
--- /dev/null
+++ b/win32build/env-x64-release.bat
@@ -0,0 +1,22 @@
+ at rem Setting environment for BIND10 - x64.Release
+
+ at echo off
+
+pushd %CD%
+cd %BIND10HOME%
+set b10home=%CD%
+cd ..
+set b10parent=%CD%
+popd
+
+set B10_FROM_BUILD=%BIND10HOME%
+set PATH=%PATH%;%PYTHONDIR%
+set PATH=%PATH%;%b10parent%\gtest\x64.Release
+set PATH=%PATH%;%b10parent%\botan\x64.Release
+set PATH=%PATH%;%b10parent%\log4cplus\x64.Release
+set PATH=%PATH%;%b10parent%\sqlite3\x64.Release
+set PATH=%PATH%;%b10home%\win32build\VS\x64.Release
+set PYTHONPATH=%PYTHONPATH%;%b10home%\win32build\VS\x64.Release
+set PYTHONPATH=%PYTHONPATH%;%b10home%\src\lib\python\isc\util
+set PYTHON=%PYTHONDIR%\python.exe
+set BIND10_PATH=%BIND10HOME%/src/bin/bind10
diff --git a/win32build/env-x64-release.sh b/win32build/env-x64-release.sh
new file mode 100755
index 0000000..289738f
--- /dev/null
+++ b/win32build/env-x64-release.sh
@@ -0,0 +1,16 @@
+# Setting environment for BIND10 - x64.Release
+
+export B10_FROM_BUILD=${BIND10HOME}
+parent=`cygpath ${BIND10HOME}/..`
+b10home=`cygpath ${BIND10HOME}`
+pydir=`cygpath ${PYTHONDIR}`
+export PATH="${PATH}:${pydir}"
+export PATH="${PATH}:${parent}gtest/x64.Release"
+export PATH="${PATH}:${parent}botan/x64.Release"
+export PATH="${PATH}:${parent}log4cplus/x64.Release"
+export PATH="${PATH}:${parent}sqlite3/x64.Release"
+export PATH="${PATH}:${b10home}/win32build/VS/x64.Release"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/win32build/VS/x64.Release"
+export PYTHONPATH="${PYTHONPATH};${BIND10HOME}/src/lib/python/isc/util"
+export PYTHON=${pydir}/python.exe
+export BIND10_PATH=${BIND10HOME}/src/bin/bind10
diff --git a/win32build/getopt.cc b/win32build/getopt.cc
new file mode 100644
index 0000000..fa46d4d
--- /dev/null
+++ b/win32build/getopt.cc
@@ -0,0 +1,79 @@
+/* ::[[ @(#) getopt.c 1.5 89/03/11 05:40:23 ]]:: */
+#ifndef LINT
+static const char Id[] = "$Id: getopt.c,v 1.2 2002/11/22 22:06:46 tom Exp $";
+#endif
+
+/*
+ * Here's something you've all been waiting for: the AT&T public domain
+ * source for getopt(3). It is the code which was given out at the 1985
+ * UNIFORUM conference in Dallas. I obtained it by electronic mail
+ * directly from AT&T. The people there assure me that it is indeed
+ * in the public domain.
+ *
+ * There is no manual page. That is because the one they gave out at
+ * UNIFORUM was slightly different from the current System V Release 2
+ * manual page. The difference apparently involved a note about the
+ * famous rules 5 and 6, recommending using white space between an option
+ * and its first argument, and not grouping options that have arguments.
+ * Getopt itself is currently lenient about both of these things White
+ * space is allowed, but not mandatory, and the last option in a group can
+ * have an argument. That particular version of the man page evidently
+ * has no official existence, and my source at AT&T did not send a copy.
+ * The current SVR2 man page reflects the actual behavor of this getopt.
+ * However, I am not about to post a copy of anything licensed by AT&T.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#define ERR(szz,czz) if(opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);}
+
+int opterr = 1;
+int optind = 1;
+int optopt;
+char *optarg;
+
+int
+getopt(int argc, char * const argv[], const char *opts)
+{
+ static int sp = 1;
+ register int c;
+ register const char *cp;
+
+ if (sp == 1) {
+ if (optind >= argc ||
+ argv[optind][0] != '-' || argv[optind][1] == '\0')
+ return (EOF);
+ else if (strcmp(argv[optind], "--") == 0) {
+ optind++;
+ return (EOF);
+ }
+ }
+ optopt = c = argv[optind][sp];
+ if (c == ':' || (cp = strchr(opts, c)) == NULL) {
+ ERR(": illegal option -- ", c);
+ if (argv[optind][++sp] == '\0') {
+ optind++;
+ sp = 1;
+ }
+ return ('?');
+ }
+ if (*++cp == ':') {
+ if (argv[optind][sp + 1] != '\0')
+ optarg = &argv[optind++][sp + 1];
+ else if (++optind >= argc) {
+ ERR(": option requires an argument -- ", c);
+ sp = 1;
+ return ('?');
+ } else
+ optarg = argv[optind++];
+ sp = 1;
+ } else {
+ if (argv[optind][++sp] == '\0') {
+ sp = 1;
+ optind++;
+ }
+ optarg = NULL;
+ }
+ return (c);
+}
diff --git a/win32build/getopt.h b/win32build/getopt.h
new file mode 100644
index 0000000..e70e5a7
--- /dev/null
+++ b/win32build/getopt.h
@@ -0,0 +1,4 @@
+extern char *optarg;
+extern int optind, opterr;
+
+int getopt (int argc, char * const argv[], const char *options);
diff --git a/win32build/getopt_long.cc b/win32build/getopt_long.cc
new file mode 100644
index 0000000..face900
--- /dev/null
+++ b/win32build/getopt_long.cc
@@ -0,0 +1,523 @@
+/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
+/* $FreeBSD: src/lib/libc/stdlib/getopt_long.c,v 1.2 2002/10/16 22:18:42 alfred Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include <getopt_long.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef _WIN32
+
+/* Windows needs warnx(). We change the definition though:
+ * 1. (another) global is defined, opterrmsg, which holds the error message
+ * 2. errors are always printed out on stderr w/o the program name
+ * Note that opterrmsg always gets set no matter what opterr is set to. The
+ * error message will not be printed if opterr is 0 as usual.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+
+extern char opterrmsg[128];
+char opterrmsg[128]; /* last error message is stored here */
+
+static void warnx(int print_error, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ if (fmt != NULL)
+ _vsnprintf(opterrmsg, 128, fmt, ap);
+ else
+ opterrmsg[0]='\0';
+ va_end(ap);
+ if (print_error) {
+ fprintf(stderr, opterrmsg);
+ fprintf(stderr, "\n");
+ }
+}
+
+#endif /*_WIN32*/
+
+/* not part of the original file */
+#ifndef _DIAGASSERT
+#define _DIAGASSERT(X)
+#endif
+
+#if HAVE_CONFIG_H && !HAVE_GETOPT_LONG && !HAVE_DECL_OPTIND
+#define REPLACE_GETOPT
+#endif
+
+int opterr = 1; /* if error message should be printed */
+int optind = 1; /* index into parent argv vector */
+int optopt = '?'; /* character checked for validity */
+int optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+
+#if !HAVE_GETOPT_LONG
+#define IGNORE_FIRST (*options == '-' || *options == '+')
+#define PRINT_ERROR ((opterr) && ((*options != ':') \
+ || (IGNORE_FIRST && options[1] != ':')))
+#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL)
+#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST)
+/* XXX: GNU ignores PC if *options == '-' */
+#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-')
+
+/* return values */
+#define BADCH (int)'?'
+#define BADARG ((IGNORE_FIRST && options[1] == ':') \
+ || (*options == ':') ? (int)':' : (int)'?')
+#define INORDER (int)1
+
+#define EMSG ""
+
+static int getopt_internal(int, char * const *, const char *);
+static int gcd(int, int);
+static void permute_args(int, int, int, char * const *);
+
+static char *place = EMSG; /* option letter processing */
+
+/* XXX: set optreset to 1 rather than these two */
+static int nonopt_start = -1; /* first non option argument (for permute) */
+static int nonopt_end = -1; /* first option after non options (for permute) */
+
+/* Error messages */
+static const char recargchar[] = "option requires an argument -- %c";
+static const char recargstring[] = "option requires an argument -- %s";
+static const char ambig[] = "ambiguous option -- %.*s";
+static const char noarg[] = "option doesn't take an argument -- %.*s";
+static const char illoptchar[] = "unknown option -- %c";
+static const char illoptstring[] = "unknown option -- %s";
+
+
+/*
+ * Compute the greatest common divisor of a and b.
+ */
+static int
+gcd(int a, int b)
+{
+ int c;
+
+ c = a % b;
+ while (c != 0) {
+ a = b;
+ b = c;
+ c = a % b;
+ }
+
+ return b;
+}
+
+/*
+ * Exchange the block from nonopt_start to nonopt_end with the block
+ * from nonopt_end to opt_end (keeping the same order of arguments
+ * in each block).
+ */
+static void
+permute_args(int panonopt_start, int panonopt_end,
+ int opt_end, char * const *nargv)
+{
+ int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
+ char *swap;
+
+ _DIAGASSERT(nargv != NULL);
+
+ /*
+ * compute lengths of blocks and number and size of cycles
+ */
+ nnonopts = panonopt_end - panonopt_start;
+ nopts = opt_end - panonopt_end;
+ ncycle = gcd(nnonopts, nopts);
+ cyclelen = (opt_end - panonopt_start) / ncycle;
+
+ for (i = 0; i < ncycle; i++) {
+ cstart = panonopt_end+i;
+ pos = cstart;
+ for (j = 0; j < cyclelen; j++) {
+ if (pos >= panonopt_end)
+ pos -= nnonopts;
+ else
+ pos += nopts;
+ swap = nargv[pos];
+ /* LINTED const cast */
+ ((char **) nargv)[pos] = nargv[cstart];
+ /* LINTED const cast */
+ ((char **)nargv)[cstart] = swap;
+ }
+ }
+}
+
+/*
+ * getopt_internal --
+ * Parse argc/argv argument vector. Called by user level routines.
+ * Returns -2 if -- is found (can be long option or end of options marker).
+ */
+static int
+getopt_internal(int nargc, char * const *nargv, const char *options)
+{
+ char *oli; /* option letter list index */
+ int optchar;
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(options != NULL);
+
+ optarg = NULL;
+
+ /*
+ * XXX Some programs (like rsyncd) expect to be able to
+ * XXX re-initialize optind to 0 and have getopt_long(3)
+ * XXX properly function again. Work around this braindamage.
+ */
+ if (optind == 0)
+ optind = 1;
+
+ if (optreset)
+ nonopt_start = nonopt_end = -1;
+start:
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc) { /* end of argument vector */
+ place = EMSG;
+ if (nonopt_end != -1) {
+ /* do permutation, if we have to */
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ else if (nonopt_start != -1) {
+ /*
+ * If we skipped non-options, set optind
+ * to the first of them.
+ */
+ optind = nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ return -1;
+ }
+ if ((*(place = nargv[optind]) != '-')
+ || (place[1] == '\0')) { /* found non-option */
+ place = EMSG;
+ if (IN_ORDER) {
+ /*
+ * GNU extension:
+ * return non-option as argument to option 1
+ */
+ optarg = nargv[optind++];
+ return INORDER;
+ }
+ if (!PERMUTE) {
+ /*
+ * if no permutation wanted, stop parsing
+ * at first non-option
+ */
+ return -1;
+ }
+ /* do permutation */
+ if (nonopt_start == -1)
+ nonopt_start = optind;
+ else if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ nonopt_start = optind -
+ (nonopt_end - nonopt_start);
+ nonopt_end = -1;
+ }
+ optind++;
+ /* process next argument */
+ goto start;
+ }
+ if (nonopt_start != -1 && nonopt_end == -1)
+ nonopt_end = optind;
+ if (place[1] && *++place == '-') { /* found "--" */
+ place++;
+ return -2;
+ }
+ }
+ if ((optchar = (int)*place++) == (int)':' ||
+ (oli = (char *) strchr(options + (IGNORE_FIRST ? 1 : 0),
+ optchar)) == NULL) {
+ /* option letter unknown or ':' */
+ if (!*place)
+ ++optind;
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(illoptchar, optchar);
+#else
+ warnx(PRINT_ERROR, illoptchar, optchar);
+#endif
+ optopt = optchar;
+ return BADCH;
+ }
+ if (optchar == 'W' && oli[1] == ';') { /* -W long-option */
+ /* XXX: what if no long options provided (called by getopt)? */
+ if (*place)
+ return -2;
+
+ if (++optind >= nargc) { /* no arg */
+ place = EMSG;
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(recargchar, optchar);
+#else
+ warnx(PRINT_ERROR, recargchar, optchar);
+#endif
+ optopt = optchar;
+ return BADARG;
+ } else /* white space */
+ place = nargv[optind];
+ /*
+ * Handle -W arg the same as --arg (which causes getopt to
+ * stop parsing).
+ */
+ return -2;
+ }
+ if (*++oli != ':') { /* doesn't take argument */
+ if (!*place)
+ ++optind;
+ } else { /* takes (optional) argument */
+ optarg = NULL;
+ if (*place) /* no white space */
+ optarg = place;
+ /* XXX: disable test for :: if PC? (GNU doesn't) */
+ else if (oli[1] != ':') { /* arg not optional */
+ if (++optind >= nargc) { /* no arg */
+ place = EMSG;
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(recargchar, optchar);
+#else
+ warnx(PRINT_ERROR, recargchar, optchar);
+#endif
+ optopt = optchar;
+ return BADARG;
+ } else
+ optarg = nargv[optind];
+ }
+ place = EMSG;
+ ++optind;
+ }
+ /* dump back option letter */
+ return optchar;
+}
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ *
+ * [eventually this will replace the real getopt]
+ */
+int
+getopt(int nargc, char * const *nargv, const char *options)
+{
+ int retval;
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(options != NULL);
+
+ if ((retval = getopt_internal(nargc, nargv, options)) == -2) {
+ ++optind;
+ /*
+ * We found an option (--), so if we skipped non-options,
+ * we have to permute.
+ */
+ if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end, optind,
+ nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ retval = -1;
+ }
+ return retval;
+}
+
+/*
+ * getopt_long --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_long(int nargc,
+ char * const *nargv,
+ const char *options,
+ const struct option *long_options,
+ int *idx)
+{
+ int retval;
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(options != NULL);
+ _DIAGASSERT(long_options != NULL);
+ /* idx may be NULL */
+
+ if ((retval = getopt_internal(nargc, nargv, options)) == -2) {
+ char *current_argv, *has_equal;
+ size_t current_argv_len;
+ int i, match;
+
+ current_argv = place;
+ match = -1;
+
+ optind++;
+ place = EMSG;
+
+ if (*current_argv == '\0') { /* found "--" */
+ /*
+ * We found an option (--), so if we skipped
+ * non-options, we have to permute.
+ */
+ if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ return -1;
+ }
+ if ((has_equal = strchr(current_argv, '=')) != NULL) {
+ /* argument found (--option=arg) */
+ current_argv_len = has_equal - current_argv;
+ has_equal++;
+ } else
+ current_argv_len = strlen(current_argv);
+
+ for (i = 0; long_options[i].name; i++) {
+ /* find matching long option */
+ if (strncmp(current_argv, long_options[i].name,
+ current_argv_len))
+ continue;
+
+ if (strlen(long_options[i].name) ==
+ (unsigned)current_argv_len) {
+ /* exact match */
+ match = i;
+ break;
+ }
+ if (match == -1) /* partial match */
+ match = i;
+ else {
+ /* ambiguous abbreviation */
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(ambig, (int)current_argv_len,
+ current_argv);
+#else
+ warnx(PRINT_ERROR, ambig, (int)current_argv_len,
+ current_argv);
+#endif
+ optopt = 0;
+ return BADCH;
+ }
+ }
+ if (match != -1) { /* option found */
+ if (long_options[match].has_arg == no_argument
+ && has_equal) {
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(noarg, (int)current_argv_len,
+ current_argv);
+#else
+ warnx(PRINT_ERROR, noarg, (int)current_argv_len,
+ current_argv);
+#endif
+ /*
+ * XXX: GNU sets optopt to val regardless of
+ * flag
+ */
+ if (long_options[match].flag == NULL)
+ optopt = long_options[match].val;
+ else
+ optopt = 0;
+ return BADARG;
+ }
+ if (long_options[match].has_arg == required_argument ||
+ long_options[match].has_arg == optional_argument) {
+ if (has_equal)
+ optarg = has_equal;
+ else if (long_options[match].has_arg ==
+ required_argument) {
+ /*
+ * optional argument doesn't use
+ * next nargv
+ */
+ optarg = nargv[optind++];
+ }
+ }
+ if ((long_options[match].has_arg == required_argument)
+ && (optarg == NULL)) {
+ /*
+ * Missing argument; leading ':'
+ * indicates no error should be generated
+ */
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(recargstring, current_argv);
+#else
+ warnx(PRINT_ERROR, recargstring, current_argv);
+#endif
+ /*
+ * XXX: GNU sets optopt to val regardless
+ * of flag
+ */
+ if (long_options[match].flag == NULL)
+ optopt = long_options[match].val;
+ else
+ optopt = 0;
+ --optind;
+ return BADARG;
+ }
+ } else { /* unknown option */
+#ifndef _WIN32
+ if (PRINT_ERROR)
+ warnx(illoptstring, current_argv);
+#else
+ warnx(PRINT_ERROR, illoptstring, current_argv);
+#endif
+ optopt = 0;
+ return BADCH;
+ }
+ if (long_options[match].flag) {
+ *long_options[match].flag = long_options[match].val;
+ retval = 0;
+ } else
+ retval = long_options[match].val;
+ if (idx)
+ *idx = match;
+ }
+ return retval;
+}
+#endif /* !GETOPT_LONG */
diff --git a/win32build/getopt_long.h b/win32build/getopt_long.h
new file mode 100644
index 0000000..5b9210f
--- /dev/null
+++ b/win32build/getopt_long.h
@@ -0,0 +1,104 @@
+/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
+/* $FreeBSD: src/include/getopt.h,v 1.1 2002/09/29 04:14:30 eric Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _GETOPT_H_
+#define _GETOPT_H_
+
+#ifdef _WIN32
+/* from <sys/cdefs.h> */
+# ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+# else
+# define __BEGIN_DECLS
+# define __END_DECLS
+# endif
+# define __P(args) args
+#endif
+
+/*#ifndef _WIN32
+#include <sys/cdefs.h>
+#include <unistd.h>
+#endif*/
+
+/*
+ * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions
+ */
+#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+struct option {
+ /* name of long option */
+ const char *name;
+ /*
+ * one of no_argument, required_argument, and optional_argument:
+ * whether option takes an argument
+ */
+ int has_arg;
+ /* if not NULL, set *flag to val when option found */
+ int *flag;
+ /* if flag not NULL, value to set *flag to; else return value */
+ int val;
+};
+
+__BEGIN_DECLS
+int getopt_long __P((int, char * const *, const char *,
+ const struct option *, int *));
+__END_DECLS
+#endif
+
+#ifdef _WIN32
+/* These are global getopt variables */
+__BEGIN_DECLS
+
+extern int opterr, /* if error message should be printed */
+ optind, /* index into parent argv vector */
+ optopt, /* character checked for validity */
+ optreset; /* reset getopt */
+extern char* optarg; /* argument associated with option */
+
+/* Original getopt */
+int getopt __P((int, char * const *, const char *));
+
+__END_DECLS
+#endif
+
+#endif /* !_GETOPT_H_ */
diff --git a/win32build/strptime.cc b/win32build/strptime.cc
new file mode 100644
index 0000000..84113a8
--- /dev/null
+++ b/win32build/strptime.cc
@@ -0,0 +1,181 @@
+// Copyright 2009 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+#include "strptime.h"
+
+#include <time.h>
+#include <ctype.h>
+#include <string.h>
+
+// Implement strptime under windows
+static const char* kWeekFull[] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"
+};
+
+static const char* kWeekAbbr[] = {
+ "Sun", "Mon", "Tue", "Wed",
+ "Thu", "Fri", "Sat"
+};
+
+static const char* kMonthFull[] = {
+ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December"
+};
+
+static const char* kMonthAbbr[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+static const char* _parse_num(const char* s, int low, int high, int* value) {
+ const char* p = s;
+ for (*value = 0; *p != NULL && isdigit(*p); ++p) {
+ *value = (*value) * 10 + static_cast<int>(*p) - static_cast<int>('0');
+ }
+
+ if (p == s || *value < low || *value > high) return NULL;
+ return p;
+}
+
+char* strptime(const char *s, const char *format, struct tm *tm) {
+ while (*format != NULL && *s != NULL) {
+ if (*format != '%') {
+ if (*s != *format) return NULL;
+
+ ++format;
+ ++s;
+ continue;
+ }
+
+ ++format;
+ int len = 0;
+ switch (*format) {
+ // weekday name.
+ case 'a':
+ case 'A':
+ tm->tm_wday = -1;
+ for (int i = 0; i < 7; ++i) {
+ len = static_cast<int>(strlen(kWeekAbbr[i]));
+ if (_strnicmp(kWeekAbbr[i], s, len) == 0) {
+ tm->tm_wday = i;
+ break;
+ }
+
+ len = static_cast<int>(strlen(kWeekFull[i]));
+ if (_strnicmp(kWeekFull[i], s, len) == 0) {
+ tm->tm_wday = i;
+ break;
+ }
+ }
+ if (tm->tm_wday == -1) return NULL;
+ s += len;
+ break;
+
+ // month name.
+ case 'b':
+ case 'B':
+ case 'h':
+ tm->tm_mon = -1;
+ for (int i = 0; i < 12; ++i) {
+ len = static_cast<int>(strlen(kMonthAbbr[i]));
+ if (_strnicmp(kMonthAbbr[i], s, len) == 0) {
+ tm->tm_mon = i;
+ break;
+ }
+
+ len = static_cast<int>(strlen(kMonthFull[i]));
+ if (_strnicmp(kMonthFull[i], s, len) == 0) {
+ tm->tm_mon = i;
+ break;
+ }
+ }
+ if (tm->tm_mon == -1) return NULL;
+ s += len;
+ break;
+
+ // month [1, 12].
+ case 'm':
+ s = _parse_num(s, 1, 12, &tm->tm_mon);
+ if (s == NULL) return NULL;
+ --tm->tm_mon;
+ break;
+
+ // day [1, 31].
+ case 'd':
+ case 'e':
+ s = _parse_num(s, 1, 31, &tm->tm_mday);
+ if (s == NULL) return NULL;
+ break;
+
+ // hour [0, 23].
+ case 'H':
+ s = _parse_num(s, 0, 23, &tm->tm_hour);
+ if (s == NULL) return NULL;
+ break;
+
+ // minute [0, 59]
+ case 'M':
+ s = _parse_num(s, 0, 59, &tm->tm_min);
+ if (s == NULL) return NULL;
+ break;
+
+ // seconds [0, 60]. 60 is for leap year.
+ case 'S':
+ s = _parse_num(s, 0, 60, &tm->tm_sec);
+ if (s == NULL) return NULL;
+ break;
+
+ // year [1900, 9999].
+ case 'Y':
+ s = _parse_num(s, 1900, 9999, &tm->tm_year);
+ if (s == NULL) return NULL;
+ tm->tm_year -= 1900;
+ break;
+
+ // year [0, 99].
+ case 'y':
+ s = _parse_num(s, 0, 99, &tm->tm_year);
+ if (s == NULL) return NULL;
+ if (tm->tm_year <= 68) {
+ tm->tm_year += 100;
+ }
+ break;
+
+ // arbitray whitespace.
+ case 't':
+ case 'n':
+ while (isspace(*s)) ++s;
+ break;
+
+ // '%'.
+ case '%':
+ if (*s != '%') return NULL;
+ ++s;
+ break;
+
+ // All the other format are not supported.
+ default:
+ return NULL;
+ }
+ ++format;
+ }
+
+ if (*format != NULL) {
+ return NULL;
+ } else {
+ return const_cast<char*>(s);
+ }
+}
diff --git a/win32build/strptime.h b/win32build/strptime.h
new file mode 100644
index 0000000..bc9193c
--- /dev/null
+++ b/win32build/strptime.h
@@ -0,0 +1,31 @@
+// Copyright 2009 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+// This files includes functions to support time related operations.
+// It defines common functions, which are only available on platforms.
+// It also provides functions to parse RFC times.
+
+#ifndef _TIMESUPPORT_H__
+#define _TIMESUPPORT_H__
+
+#include <time.h>
+#include <string>
+
+// Convert a string representation time to a time tm structure.
+// It is the conversion function of strftime().
+// Linux provides this function.
+char *strptime(const char *buf, const char *fmt, struct tm *tm);
+
+#endif // _TIMESUPPORT_H__
More information about the bind10-changes
mailing list