summaryrefslogtreecommitdiffstats
path: root/src/openvpnserv
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-02-29 22:12:12 +0200
committerDavid Sommerseth <davids@redhat.com>2012-03-22 22:53:39 +0100
commit4b1a82db0975088dbfe69c2a97f0a96ef972b2a4 (patch)
treefc61e38d86d9fe0898e8c427e7f3f2cf4d464529 /src/openvpnserv
parent709f7a1f73baade82f07146273d31d53007f394d (diff)
downloadopenvpn-4b1a82db0975088dbfe69c2a97f0a96ef972b2a4.tar.gz
openvpn-4b1a82db0975088dbfe69c2a97f0a96ef972b2a4.tar.xz
openvpn-4b1a82db0975088dbfe69c2a97f0a96ef972b2a4.zip
build: win-msvc: msbuild format
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/openvpnserv')
-rw-r--r--src/openvpnserv/Makefile.am3
-rwxr-xr-xsrc/openvpnserv/openvpnserv.c16
-rw-r--r--src/openvpnserv/openvpnserv.vcproj209
-rw-r--r--src/openvpnserv/openvpnserv_resources.rc2
-rw-r--r--src/openvpnserv/service.c5
-rw-r--r--src/openvpnserv/service.h2
6 files changed, 228 insertions, 9 deletions
diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am
index 58005c0..8584b06 100644
--- a/src/openvpnserv/Makefile.am
+++ b/src/openvpnserv/Makefile.am
@@ -13,6 +13,9 @@ include $(top_srcdir)/build/ltrc.inc
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+EXTRA_DIST = \
+ openvpnserv.vcproj
+
if WIN32
sbin_PROGRAMS = openvpnserv
endif
diff --git a/src/openvpnserv/openvpnserv.c b/src/openvpnserv/openvpnserv.c
index 0993064..a9a9441 100755
--- a/src/openvpnserv/openvpnserv.c
+++ b/src/openvpnserv/openvpnserv.c
@@ -33,7 +33,11 @@
* This code is designed to be built with the mingw compiler.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
@@ -196,7 +200,7 @@ match (const WIN32_FIND_DATA *find, const char *ext)
if (i < 1)
return false;
- return find->cFileName[i] == '.' && !strcasecmp (find->cFileName + i + 1, ext);
+ return find->cFileName[i] == '.' && !_stricmp (find->cFileName + i + 1, ext);
}
/*
@@ -331,15 +335,15 @@ VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
/* set process priority */
priority = NORMAL_PRIORITY_CLASS;
- if (!strcasecmp (priority_string, "IDLE_PRIORITY_CLASS"))
+ if (!_stricmp (priority_string, "IDLE_PRIORITY_CLASS"))
priority = IDLE_PRIORITY_CLASS;
- else if (!strcasecmp (priority_string, "BELOW_NORMAL_PRIORITY_CLASS"))
+ else if (!_stricmp (priority_string, "BELOW_NORMAL_PRIORITY_CLASS"))
priority = BELOW_NORMAL_PRIORITY_CLASS;
- else if (!strcasecmp (priority_string, "NORMAL_PRIORITY_CLASS"))
+ else if (!_stricmp (priority_string, "NORMAL_PRIORITY_CLASS"))
priority = NORMAL_PRIORITY_CLASS;
- else if (!strcasecmp (priority_string, "ABOVE_NORMAL_PRIORITY_CLASS"))
+ else if (!_stricmp (priority_string, "ABOVE_NORMAL_PRIORITY_CLASS"))
priority = ABOVE_NORMAL_PRIORITY_CLASS;
- else if (!strcasecmp (priority_string, "HIGH_PRIORITY_CLASS"))
+ else if (!_stricmp (priority_string, "HIGH_PRIORITY_CLASS"))
priority = HIGH_PRIORITY_CLASS;
else
{
diff --git a/src/openvpnserv/openvpnserv.vcproj b/src/openvpnserv/openvpnserv.vcproj
new file mode 100644
index 0000000..4c55561
--- /dev/null
+++ b/src/openvpnserv/openvpnserv.vcproj
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="openvpnserv"
+ ProjectGUID="{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
+ RootNamespace="openvpnserv"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(SOURCEBASE)"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="$(SOURCEBASE)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-Output\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="$(SOURCEBASE)"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS)"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="$(SOURCEBASE)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\openvpnserv.c"
+ >
+ </File>
+ <File
+ RelativePath=".\service.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\service.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\openvpnserv_resources.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/src/openvpnserv/openvpnserv_resources.rc b/src/openvpnserv/openvpnserv_resources.rc
index 9845a8f..7eac95b 100644
--- a/src/openvpnserv/openvpnserv_resources.rc
+++ b/src/openvpnserv/openvpnserv_resources.rc
@@ -1,7 +1,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#else
-#include <config-msc-version.h>
+#include <config-msvc-version.h>
#endif
#include <winresrc.h>
diff --git a/src/openvpnserv/service.c b/src/openvpnserv/service.c
index 91b5821..d7562b3 100644
--- a/src/openvpnserv/service.c
+++ b/src/openvpnserv/service.c
@@ -23,6 +23,11 @@ FUNCTIONS:
---------------------------------------------------------------------------*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/openvpnserv/service.h b/src/openvpnserv/service.h
index cf41ed7..e89a89f 100644
--- a/src/openvpnserv/service.h
+++ b/src/openvpnserv/service.h
@@ -57,8 +57,6 @@ Copyright (C) 1993 - 2000. Microsoft Corporation. All rights reserved.
extern "C" {
#endif
-#include "config.h"
-
//////////////////////////////////////////////////////////////////////////////
//// todo: change to desired strings
////