Skip to content

Commit

Permalink
Add Windows x64 project configuration, changed struct alignment to de…
Browse files Browse the repository at this point in the history
…fault to make PING/PONG and connect work.
  • Loading branch information
koenvandesande committed Feb 3, 2012
1 parent b2b9bb4 commit 822f277
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 2 deletions.
7 changes: 6 additions & 1 deletion net.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int redisCreateSocket(redisContext *c, int type) {
static int redisSetBlocking(redisContext *c, int fd, int blocking) {
#ifdef HIREDIS_WIN
int iResult;
int flag;
unsigned long flag;

if (blocking)
flag = 0;
Expand Down Expand Up @@ -260,7 +260,12 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t
if (redisSetBlocking(c,s,0) != REDIS_OK)
goto error;
if (connect(s,p->ai_addr,p->ai_addrlen) == -1) {
SETERRNO;
#ifdef HIREDIS_WIN
if (errno == WSAEHOSTUNREACH) {
#else
if (errno == EHOSTUNREACH) {
#endif
close(s);
continue;
} else if (errno == EINPROGRESS && !blocking) {
Expand Down
156 changes: 155 additions & 1 deletion win32/example/example.vcproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="example"
ProjectGUID="{9715AC8D-EA96-4943-92D5-858F65D07EDB}"
RootNamespace="example"
Expand All @@ -12,6 +12,9 @@
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
Expand Down Expand Up @@ -165,6 +168,157 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
StructMemberAlignment="0"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="17"
/>
<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|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
StructMemberAlignment="1"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<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>
Expand Down
10 changes: 10 additions & 0 deletions win32/hiredis.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,27 @@ 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
{62FE2454-AB35-4A57-9FA3-51892029221E}.Debug|Win32.ActiveCfg = Debug|Win32
{62FE2454-AB35-4A57-9FA3-51892029221E}.Debug|Win32.Build.0 = Debug|Win32
{62FE2454-AB35-4A57-9FA3-51892029221E}.Debug|x64.ActiveCfg = Debug|x64
{62FE2454-AB35-4A57-9FA3-51892029221E}.Debug|x64.Build.0 = Debug|x64
{62FE2454-AB35-4A57-9FA3-51892029221E}.Release|Win32.ActiveCfg = Release|Win32
{62FE2454-AB35-4A57-9FA3-51892029221E}.Release|Win32.Build.0 = Release|Win32
{62FE2454-AB35-4A57-9FA3-51892029221E}.Release|x64.ActiveCfg = Release|x64
{62FE2454-AB35-4A57-9FA3-51892029221E}.Release|x64.Build.0 = Release|x64
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Debug|Win32.ActiveCfg = Debug|Win32
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Debug|Win32.Build.0 = Debug|Win32
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Debug|x64.ActiveCfg = Debug|x64
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Debug|x64.Build.0 = Debug|x64
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Release|Win32.ActiveCfg = Release|Win32
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Release|Win32.Build.0 = Release|Win32
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Release|x64.ActiveCfg = Release|x64
{9715AC8D-EA96-4943-92D5-858F65D07EDB}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
130 changes: 130 additions & 0 deletions win32/hiredis.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
Expand Down Expand Up @@ -141,6 +144,133 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
StructMemberAlignment="0"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="0"
StructMemberAlignment="1"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
Expand Down

0 comments on commit 822f277

Please sign in to comment.