lib_acl, lib_protocol, lib_acl_cpp can be built by VC2012 in x64 mode

This commit is contained in:
zsxxsz 2015-06-28 20:27:51 +08:00
parent 8dc9188d4b
commit fc22796257
241 changed files with 2996 additions and 1082 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,19 +5,31 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugDll|Win32 = DebugDll|Win32
DebugDll|x64 = DebugDll|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseDll|Win32 = ReleaseDll|Win32
ReleaseDll|x64 = ReleaseDll|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|Win32.ActiveCfg = Debug|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|Win32.Build.0 = Debug|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|x64.ActiveCfg = Debug|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|x64.Build.0 = Debug|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|Win32.Build.0 = DebugDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|x64.ActiveCfg = DebugDll|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|x64.Build.0 = DebugDll|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|Win32.ActiveCfg = Release|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|Win32.Build.0 = Release|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|x64.ActiveCfg = Release|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|x64.Build.0 = Release|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|x64.ActiveCfg = ReleaseDll|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|x64.Build.0 = ReleaseDll|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -5,18 +5,34 @@
<Configuration>DebugDll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugDll|x64">
<Configuration>DebugDll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDll|Win32">
<Configuration>ReleaseDll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDll|x64">
<Configuration>ReleaseDll</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>{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}</ProjectGuid>
@ -29,60 +45,112 @@
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>Debug\</OutDir>
<OutDir>.\</OutDir>
<IntDir>Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>Debug\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>Release\</OutDir>
<IntDir>Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>Release\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<OutDir>.\</OutDir>
<IntDir>ReleaseDll\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>ReleaseDll\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<OutDir>.\</OutDir>
<IntDir>DebugDll\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>DebugDll\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -106,6 +174,28 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$<PROGRAM>.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<StackReserveSize>20240000</StackReserveSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -126,6 +216,25 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp_vc2012.lib;lib_protocol_vc2012.lib;lib_acl_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -151,6 +260,30 @@ copy ..\..\..\dist\lib\win32\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<PreBuildEvent>
<Command>copy ..\..\..\dist\lib\win64\lib_acl.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_protocol.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -178,15 +311,44 @@ copy ..\..\..\dist\lib\win32\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp_d.lib;lib_acl_d.lib;lib_protocol_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$<PROGRAM>.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
</Link>
<PreBuildEvent>
<Command>copy ..\..\..\dist\lib\win64\lib_acl_d.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_protocol_d.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="http_servlet.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="master_service.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@ -5,19 +5,31 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugDll|Win32 = DebugDll|Win32
DebugDll|x64 = DebugDll|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseDll|Win32 = ReleaseDll|Win32
ReleaseDll|x64 = ReleaseDll|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|Win32.ActiveCfg = Debug|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|Win32.Build.0 = Debug|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|x64.ActiveCfg = Debug|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Debug|x64.Build.0 = Debug|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|Win32.Build.0 = DebugDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|x64.ActiveCfg = DebugDll|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.DebugDll|x64.Build.0 = DebugDll|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|Win32.ActiveCfg = Release|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|Win32.Build.0 = Release|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|x64.ActiveCfg = Release|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.Release|x64.Build.0 = Release|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|x64.ActiveCfg = ReleaseDll|x64
{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}.ReleaseDll|x64.Build.0 = ReleaseDll|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -5,18 +5,34 @@
<Configuration>DebugDll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugDll|x64">
<Configuration>DebugDll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDll|Win32">
<Configuration>ReleaseDll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDll|x64">
<Configuration>ReleaseDll</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>{58FE3581-C997-4BD5-9AC6-AEEB54A43D2C}</ProjectGuid>
@ -29,60 +45,112 @@
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>Debug\</OutDir>
<OutDir>.\</OutDir>
<IntDir>Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>Debug\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>Release\</OutDir>
<IntDir>Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>Release\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<OutDir>.\</OutDir>
<IntDir>ReleaseDll\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>ReleaseDll\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<OutDir>.\</OutDir>
<IntDir>DebugDll\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>DebugDll\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -106,6 +174,28 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$<PROGRAM>.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<StackReserveSize>20240000</StackReserveSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -126,6 +216,25 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp_vc2012.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -151,6 +260,30 @@ copy ..\..\..\dist\lib\win32\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<PreBuildEvent>
<Command>copy ..\..\..\dist\lib\win64\lib_acl.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_protocol.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -178,14 +311,43 @@ copy ..\..\..\dist\lib\win32\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>lib_acl_cpp_d.lib;lib_acl_d.lib;lib_protocol_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$<PROGRAM>.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$<PROGRAM>.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
</Link>
<PreBuildEvent>
<Command>copy ..\..\..\dist\lib\win64\lib_acl_d.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_acl_cpp.dll $(OutDir) /Y
copy ..\..\..\dist\lib\win64\lib_protocol_d.dll $(OutDir) /Y</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="master_service.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@ -220,7 +220,7 @@ static tpl_fcell_t* tpl_produce_field(tpl_t *tpl,
}
#define tpl_get_field(tpl, key) \
tpl_produce_field((tpl), (key), strlen((key)), 0, 0)
tpl_produce_field((tpl), (key), (int) strlen((key)), 0, 0)
#define tpl_new_field(tpl, key, key_len) \
tpl_produce_field((tpl), (key), (key_len), 0, 1)
@ -263,7 +263,7 @@ static tpl_tcell_t* tpl_produce_section(tpl_t *tpl,
}
#define tpl_get_section(tpl, key) \
tpl_produce_section(tpl, key, strlen(key), 0)
tpl_produce_section(tpl, key, (int) strlen(key), 0)
#define tpl_make_section(tpl, key, key_len) \
tpl_produce_section(tpl, key, key_len, 1)
@ -278,14 +278,15 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
tpl_tcell_t **last_section = &tpl->first;
/* While a field delimiter can be found in what is left */
while ((p_curr = tpl_strstr(p_last, p_end - p_last,
while ((p_curr = tpl_strstr(p_last, (ssize_t) (p_end - p_last),
DELIMITER_LEFT, DELIM_LEN_LEFT)) != NULL)
{
/* Advance to beginning of field/section name */
p_curr += DELIM_LEN_LEFT;
/* Find end delimiter of identifier or fail with syntax error */
p_next = tpl_strstr(p_curr, p_end - p_curr, DELIMITER_RIGHT, DELIM_LEN_RIGHT);
p_next = tpl_strstr(p_curr, (ssize_t) (p_end - p_curr),
DELIMITER_RIGHT, DELIM_LEN_RIGHT);
if (p_next == NULL)
{
@ -305,7 +306,7 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
if ((p_curr - SEC_HEAD_LEN - p_last) != 0)
{
int val_len = p_curr - SEC_HEAD_LEN - p_last;
int val_len = (int) (p_curr - SEC_HEAD_LEN - p_last);
*tail = create_node(val_len);
(*tail)->val[val_len] = 0;
(void)memcpy((*tail)->val, p_last, val_len);
@ -313,7 +314,7 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
}
/* Create and chain in entry for section */
section = tpl_make_section(tpl, p_curr, p_next - p_curr);
section = tpl_make_section(tpl, p_curr, (int) (p_next - p_curr));
if (section != NULL)
{
@ -330,9 +331,9 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
/* Find next occurrence of this section tag */
ending = tpl_strstr(beginning,
p_end - beginning,
(int) (p_end - beginning),
p_curr - SEC_HEAD_LEN,
beginning - p_curr + SEC_HEAD_LEN);
(int) (beginning - p_curr + SEC_HEAD_LEN));
p_last = ending + (SEC_HEAD_LEN + p_last - p_curr);
@ -366,7 +367,7 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
{
if ((p_curr - DELIM_LEN_LEFT - p_last) != 0)
{
int val_len = p_curr - DELIM_LEN_LEFT - p_last;
int val_len = (int) (p_curr - DELIM_LEN_LEFT - p_last);
*tail = create_node(val_len);
(*tail)->val[val_len] = 0;
(void)memcpy((*tail)->val, p_last, val_len);
@ -378,7 +379,7 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
/* Create node and set fval to new field cell */
*tail = create_node(0);
(*tail)->val = NULL;
(*tail)->fval = tpl_new_field(tpl, p_curr, p_next - p_curr);
(*tail)->fval = tpl_new_field(tpl, p_curr, (int) (p_next - p_curr));
tail = &(*tail)->next;
}
}
@ -386,7 +387,7 @@ static int tpl_construct(tpl_t *tpl, const char *p_last, const char *p_end)
/* Store rest of the text */
if (p_last < p_end)
{
int val_len = p_end - p_last;
int val_len = (int) (p_end - p_last);
*tail = create_node(val_len);
(void)memcpy((*tail)->val, p_last, val_len);
(*tail)->val[val_len] = 0;
@ -600,7 +601,7 @@ void tpl_copy(tpl_t* tpl, const tpl_t* srctpl)
tpl_cpy_field((*tail)->fval,
tpl,
curr_node->fval->key,
strlen(curr_node->fval->key),
(int) strlen(curr_node->fval->key),
curr_node->fval->val,
curr_node->fval->len);
@ -613,7 +614,7 @@ void tpl_copy(tpl_t* tpl, const tpl_t* srctpl)
/* Create emtpy section entry for current section */
*last_section = tpl_make_section(tpl,
curr_section->key,
strlen(curr_section->key));
(int) strlen(curr_section->key));
(*last_section)->preceding = tail;
@ -675,7 +676,7 @@ void tpl_copy(tpl_t* tpl, const tpl_t* srctpl)
tpl_cpy_field((*tail)->fval,
tpl,
curr_node->fval->key,
strlen(curr_node->fval->key),
(int) strlen(curr_node->fval->key),
curr_node->fval->val,
curr_node->fval->len);
}
@ -1184,7 +1185,7 @@ int tpl_save_as(const tpl_t* tpl, const char* filename)
tpl_get_content(tpl, content);
n = fwrite(content, len, 1, fp);
n = (int) fwrite(content, len, 1, fp);
if (n != 1)
{
(void)fclose(fp);
@ -1252,7 +1253,8 @@ int tpl_http_write(const tpl_t* tpl, int fd)
str_p += sizeof(TPL_NPH_HTTP_HEADER_END) - 1;
tpl_get_content(tpl, str_p);
content_len = write(fd, response, content_len + (str_p - response));
content_len = write(fd, response, content_len
+ (unsigned int) (str_p - response));
acl_myfree(response);
if (content_len < 0)

View File

@ -5,10 +5,18 @@
<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>{84376B60-FF20-4FD0-967E-C568FC2FBC53}</ProjectGuid>
@ -21,20 +29,36 @@
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
@ -44,11 +68,21 @@
<IntDir>Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>Debug\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>Release\</OutDir>
<IntDir>Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>Release\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -71,6 +105,26 @@
<AdditionalDependencies>lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\lib_acl\include;..\..\lib_protocol\include;..\..\lib_acl_cpp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\dist\lib\win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)wizard.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>lib_acl_cpp_vc2012d.lib;lib_acl_vc2012d.lib;lib_protocol_vc2012d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -91,13 +145,34 @@
<AdditionalDependencies>lib_acl_cpp_vc2012.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..\lib_acl\include;..\..\lib_protocol\include;..\..\lib_acl_cpp\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<OutputFile>$(OutDir)wizard.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalLibraryDirectories>..\..\dist\lib\win64;</AdditionalLibraryDirectories>
<AdditionalDependencies>lib_acl_cpp_vc2012.lib;lib_acl_vc2012.lib;lib_protocol_vc2012.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="file_tmpl.cpp" />
<ClCompile Include="http_creator.cpp" />
<ClCompile Include="master_creator.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="tpllib.cpp" />
<ClCompile Include="wizard.cpp" />

View File

@ -10,7 +10,7 @@
# include <ctype.h>
# include <limits.h> /* CHAR_BIT */
# ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# include <process.h>
# include <stdio.h>
# include <stdarg.h>

View File

@ -1,6 +1,11 @@
修改历史列表:
------------------------------------------------------------------------
493) 2015.6.28
493.1) compile: 支持在 VC x64 环境下编译使用
493.2) workaroud: 为了防止因在 acl_define_win32.h 中将 FD_SETSIZE 设置的过大
而导致进程在64位环境下堆栈溢出VC 编译时的默认堆栈为1MB将 FD_SETSIZE 设为 40000
492) 2015.6.24
492.1) bugfix: acl_vstring.c 中 acl_vstring_init 函数应禁止使用内存池方式

View File

@ -134,7 +134,7 @@ ACL_API ACL_EVENT *acl_event_new_kernel_thr(int delay_sec, int delay_usec);
*/
ACL_API ACL_EVENT *acl_event_new_wmsg(unsigned int nMsg);
#ifdef WIN32
#if defined (WIN32) || defined(WIN64)
ACL_API HWND acl_event_wmsg_hwnd(ACL_EVENT *eventp);
#endif

View File

@ -9,7 +9,7 @@ extern "C" {
typedef struct ACL_IFADDR {
char *name; /* 接口名称 */
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
char *desc; /* 接口描述 */
#endif
char ip[32]; /* 以字符串表示的IP地址 */

View File

@ -3,6 +3,7 @@
#ifdef MINGW
# undef WIN32
# undef WIN64
#else
# include "acl_define_win32.h"
#endif

View File

@ -12,7 +12,8 @@
* vc++11.0 VS 2012 1700
*/
#if defined (WIN32)
#if defined (WIN32) || defined(WIN64)
# define ACL_WINDOWS
# if _MSC_VER >= 1500
# ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
@ -22,7 +23,7 @@
# define ACL_BCB_COMPILER
#endif
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# ifdef acl_assert
# undef acl_assert
@ -43,9 +44,23 @@
# define ACL_API
# endif
/* see WINSOCK2.H, 用户需要预先定义此值因其默认值为64 */
/**
* see WINSOCK2.H, 64
* X64 fd_set
* typedef struct fd_set {
* u_int fd_count;
* SOCKET fd_array[FD_SETSIZE];
* } fd_set;
* x64 FD_SETSIZE=50000
* 8 + sizeof(SOCKET) * FD_SETSIZE = 400008
* events_select_thr.c event_loop fd_set
* > 1MB VC 1MB
* 线
* FD_SSETSIZE
*
*/
# ifndef FD_SETSIZE
# define FD_SETSIZE 50000
# define FD_SETSIZE 40000
# endif
# include <fcntl.h>
@ -82,7 +97,7 @@
#endif /* WIN32 */
/* errno define */
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# define ACL_ETIMEDOUT WSAETIMEDOUT
# define ACL_ENOMEM WSAENOBUFS
# define ACL_EINVAL WSAEINVAL
@ -151,6 +166,6 @@ ACL_API int acl_fstat(ACL_FILE_HANDLE fh, struct acl_stat *buf);
# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
# endif
*/
#endif /* WIN32 */
#endif /* WIN32 / WIN64 */
#endif /* __ACL_DEFINE_WIN32_INCLUDE_H__ */

View File

@ -7,7 +7,7 @@ extern "C" {
#include "acl_define.h"
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
#if !defined(_UNICODE)

View File

@ -23,7 +23,7 @@ struct ACL_FHANDLE {
acl_int64 fsize; /**< 存储文件大小 */
int nrefer; /**< 该存储句柄被引用的计数值 */
acl_pthread_mutex_t mutex; /**< 线程锁 */
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
unsigned long tid; /**< 打开该存储的线程号 */
unsigned long lock_mutex_tid; /**< 加线程锁的线程号 */
#else

View File

@ -13,7 +13,7 @@ extern ACL_API char *acl_optarg;
ACL_API void acl_getopt_init(void);
ACL_API int acl_getopt(int argc, char **argv, const char *opts);
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# define optind acl_optind
# define optarg acl_optarg
# define getopt_init acl_getopt_init

View File

@ -16,7 +16,7 @@ extern "C" {
* @param _size {int}
*/
#ifndef ACL_SAFE_STRNCPY
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
#define ACL_SAFE_STRNCPY(_obj, _src, _size) do { \
size_t _n = strlen(_src); \
_n = _n > (size_t ) _size - 1? (size_t) _size - 1 : _n; \
@ -205,7 +205,7 @@ ACL_API int acl_strncasecmp(const char *s1, const char *s2, size_t n);
/**
* WINDOWS下不支持一些字符串比较函数
*/
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# ifndef strcasestr
# define strcasestr acl_strcasestr
# endif

View File

@ -8,7 +8,7 @@ extern "C" {
#include "acl_define.h"
#include "acl_vstream.h"
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
struct iovec {
void *iov_base; /**< Starting address */
size_t iov_len; /**< Number of bytes */

View File

@ -162,7 +162,7 @@ struct ACL_VSTREAM {
int nrefer; /**< refer count, used for engine moudle */
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
int pid;
HANDLE hproc;
ACL_SOCKET iocp_sock;

View File

@ -40,7 +40,7 @@
# include <stdint.h> /* uintptr_t */
#endif
# define HAS_UINTPTR
#elif defined(WIN32)
#elif defined(WIN32) || defined(WIN64)
# include <stddef.h>
# define HAS_UINTPTR
#endif

View File

@ -49,7 +49,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdlib/acl_define.h"
#include "thread/acl_pthread.h"
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# define ACL_HAVE_NO_RWLOCK
#endif

View File

@ -6,7 +6,7 @@ extern "C" {
#endif
#include "stdlib/acl_define.h"
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
typedef struct ACL_SEM ACL_SEM;
struct ACL_SEM {

View File

@ -1,6 +1,10 @@
<?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="DebugDll|x64">
<Configuration>DebugDll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@ -9,14 +13,26 @@
<Configuration>DebugDll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDll|Win32">
<Configuration>ReleaseDll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDll|x64">
<Configuration>ReleaseDll</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">
<ProjectName>lib_acl</ProjectName>
@ -30,69 +46,138 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<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 Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<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>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Release|x64'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">ReleaseDll\</IntDir>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">DebugDll\</IntDir>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<ExtensionsToDeleteOnClean Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b*.map%3b*.pch%3b$(TargetPath)</ExtensionsToDeleteOnClean>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)_vc2012</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)_vc2012</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_vc2012d</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_vc2012d</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">$(ProjectName)_d</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IntDir>.\Debug\</IntDir>
<OutDir>.\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\</OutDir>
<IntDir>.\Release\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">
<OutDir>.\</OutDir>
<IntDir>DebugDll\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">
<OutDir>.\</OutDir>
<IntDir>ReleaseDll\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -127,6 +212,39 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y</Command>
<Culture>0x0804</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>.\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_LIB;_MT;ACL_PREPARE_COMPILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/acl_lib.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectName)_vc2012.pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(ProjectName)_vc2012.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
<PostBuildEvent>
<Command>copy $(TargetName).lib ..\dist\lib\win64\$(TargetName).lib /Y
copy $(TargetName).pdb ..\dist\lib\win64\$(TargetName).pdb /Y</Command>
</PostBuildEvent>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0804</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -159,6 +277,38 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y</Command>
<Culture>0x0804</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>.\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_LIB;_MT;ACL_PREPARE_COMPILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderOutputFile>$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>$(ProjectName)_vc2012d.pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Lib>
<OutputFile>$(ProjectName)_vc2012d.lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
<PostBuildEvent>
<Command>copy $(TargetName).lib ..\dist\lib\win64\$(TargetName).lib /Y
copy $(TargetName).pdb ..\dist\lib\win64\$(TargetName).pdb /Y</Command>
</PostBuildEvent>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0804</Culture>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -177,6 +327,26 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y</Command>
<Command>copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y
copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y
copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_LIB;_MT;ACL_PREPARE_COMPILE;ACL_DLL;ACL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<ProgramDataBaseFileName>$(ProjectName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;ws2_32.lib;IPHlpApi.Lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(ProjectName).dll</OutputFile>
</Link>
<PostBuildEvent>
<Command>copy $(TargetName).lib ..\dist\lib\win64\$(TargetName).lib /Y
copy $(TargetName).dll ..\dist\lib\win64\$(TargetName).dll /Y
copy $(TargetName).pdb ..\dist\lib\win64\$(TargetName).pdb /Y
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
@ -207,15 +377,48 @@ copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
<Command>copy $(TargetName).lib ..\dist\lib\win32\$(TargetName).lib /Y
copy $(TargetName).dll ..\dist\lib\win32\$(TargetName).dll /Y
copy $(TargetName).pdb ..\dist\lib\win32\$(TargetName).pdb /Y
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>.\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_LIB;_MT;ACL_DLL;ACL_EXPORTS;ACL_PREPARE_COMPILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<ProgramDataBaseFileName>$(ProjectName)_d.pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;ws2_32.lib;IPHlpApi.Lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(ProjectName)_d.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>false</MapExports>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
</Link>
<PostBuildEvent>
<Command>copy $(TargetName).lib ..\dist\lib\win64\$(TargetName).lib /Y
copy $(TargetName).dll ..\dist\lib\win64\$(TargetName).dll /Y
copy $(TargetName).pdb ..\dist\lib\win64\$(TargetName).pdb /Y
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include=".\src\acl_stdafx.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugDll|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugDll|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseDll|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include=".\src\code\acl_base64.c" />
<ClCompile Include=".\src\code\acl_gbcode.c" />

View File

@ -48,7 +48,7 @@ ACL_AIO *acl_aio_create2(int event_mode, unsigned int nMsg)
acl_msg_fatal("%s: calloc error(%s)",
myname, acl_last_strerror(ebuf, sizeof(ebuf)));
#ifdef WIN32
#ifdef ACL_WINDOWS
aio->tid = acl_pthread_self();
#endif

View File

@ -34,7 +34,7 @@
} \
} while (0)
#ifdef WIN32
#ifdef ACL_WINDOWS
static void __connect_notify_callback(int event_type, ACL_EVENT *event,
ACL_VSTREAM *stream, void *context);
@ -76,7 +76,7 @@ static void __connect_notify_callback(int event_type, ACL_EVENT *event,
return;
}
#ifdef WIN32
#ifdef ACL_WINDOWS
/* 如果是基于 win32 窗口消息的事件引擎则需要取消之前设置的超时定时器 */
if (astream->aio->event_mode == ACL_EVENT_WMSG)
acl_aio_cancel_timer(astream->aio, ConnectTimer, astream);
@ -199,7 +199,7 @@ ACL_ASTREAM *acl_aio_connect(ACL_AIO *aio, const char *addr, int timeout)
if (astream == NULL)
acl_msg_fatal("%s: open astream error", myname);
#ifdef WIN32
#ifdef ACL_WINDOWS
if (timeout > 0 && aio->event_mode == ACL_EVENT_WMSG)
acl_aio_request_timer(aio, ConnectTimer, astream,
timeout * 1000000, 0);

View File

@ -154,7 +154,7 @@ static int __gets_peek(ACL_ASTREAM *astream)
*/
if (ACL_VSTRING_LEN(&astream->strbuf) > 0) {
char *ptr = acl_vstring_str(&astream->strbuf);
int len = ACL_VSTRING_LEN(&astream->strbuf);
int len = (int) ACL_VSTRING_LEN(&astream->strbuf);
(void) read_complete_callback(astream, ptr, len);
}
@ -164,7 +164,7 @@ static int __gets_peek(ACL_ASTREAM *astream)
return -1;
} else if (ready) {
char *ptr = acl_vstring_str(&astream->strbuf);
int len = ACL_VSTRING_LEN(&astream->strbuf);
int len = (int) ACL_VSTRING_LEN(&astream->strbuf);
/* 回调用户的读行成功处理函数 */
n = read_complete_callback(astream, ptr, len);
@ -344,7 +344,7 @@ static int __read_peek(ACL_ASTREAM *astream)
/* 必须查看缓冲区中是否还有数据, 必须兼容数据读不够的情况! */
if (ACL_VSTRING_LEN(&astream->strbuf) > 0) {
char *ptr = acl_vstring_str(&astream->strbuf);
int len = ACL_VSTRING_LEN(&astream->strbuf);
int len = (int) ACL_VSTRING_LEN(&astream->strbuf);
(void) read_complete_callback(astream, ptr, len);
}
@ -354,7 +354,7 @@ static int __read_peek(ACL_ASTREAM *astream)
return -1;
} else if (n > 0) {
char *ptr = acl_vstring_str(&astream->strbuf);
int len = ACL_VSTRING_LEN(&astream->strbuf);
int len = (int) ACL_VSTRING_LEN(&astream->strbuf);
/* 回调用户的读成功处理函数 */
n = read_complete_callback(astream, ptr, len);
@ -493,7 +493,7 @@ static int __readn_peek(ACL_ASTREAM *astream)
const char *myname = "__readn_peek";
int n, ready = 0;
n = ACL_VSTRING_LEN(&astream->strbuf);
n = (int) ACL_VSTRING_LEN(&astream->strbuf);
if (astream->count <= n)
acl_msg_fatal("%s: count(%d) < strlen(%d), read_netsted(%d)",
@ -516,7 +516,7 @@ static int __readn_peek(ACL_ASTREAM *astream)
/* XXX: 查看缓冲区中是否还有数据, 必须兼容数据读不够的情况! */
if (ACL_VSTRING_LEN(&astream->strbuf) > 0) {
char *ptr = acl_vstring_str(&astream->strbuf);
int len = ACL_VSTRING_LEN(&astream->strbuf);
int len = (int) ACL_VSTRING_LEN(&astream->strbuf);
acl_msg_warn("%s: nneed(%d), nread(%d),"
" read_netsted(%d), nrefer(%d)",
@ -532,7 +532,7 @@ static int __readn_peek(ACL_ASTREAM *astream)
} else if (ready) {
/* ok, 已经满足读条件,即已经获得了所要求数据长度的数据 */
char *ptr = acl_vstring_str(&astream->strbuf);
int len = ACL_VSTRING_LEN(&astream->strbuf);
int len = (int) ACL_VSTRING_LEN(&astream->strbuf);
if (len != astream->count)
acl_msg_fatal("%s: len: %d != count: %d",

View File

@ -240,7 +240,7 @@ void aio_delay_check(ACL_AIO *aio)
#define ACL_USE_EVENT_TIMER
#ifdef WIN32
#ifdef ACL_WINDOWS
# ifdef ACL_USE_TLS_POOL
@ -313,7 +313,7 @@ static void init_thread_aio(void)
# endif /* ACL_USE_TLS_POOL */
#endif /* WIN32 */
#endif /* ACL_WINDOWS */
/* 该函数非常关键采用的IO完成时才关闭的策略防止重复关闭 */
void acl_aio_iocp_close(ACL_ASTREAM *astream)
@ -341,7 +341,7 @@ void acl_aio_iocp_close(ACL_ASTREAM *astream)
aio->dead_streams->push_back(aio->dead_streams, astream);
astream->flag |= ACL_AIO_FLAG_DELAY_CLOSE;
aio_disable_readwrite(aio, astream);
#ifdef WIN32
#ifdef ACL_WINDOWS
# ifdef ACL_USE_TLS_POOL
@ -395,7 +395,7 @@ void acl_aio_iocp_close(ACL_ASTREAM *astream)
# endif /* ACL_USE_TLS_POOL */
#endif /* WIN32 */
#endif /* ACL_WINDOWS */
}
void acl_aio_add_read_hook(ACL_ASTREAM *astream,

View File

@ -113,7 +113,7 @@ static int __try_fflush(ACL_ASTREAM *astream)
* --- zsx :)
*/
dlen = ACL_VSTRING_LEN(str) - astream->write_offset;
dlen = (int) ACL_VSTRING_LEN(str) - astream->write_offset;
ptr = acl_vstring_str(str) + astream->write_offset;
/* 开始进行非阻塞式写操作 */
n = acl_vstream_write(astream->stream, ptr, dlen);
@ -335,7 +335,7 @@ void acl_aio_vfprintf(ACL_ASTREAM *astream, const char *fmt, va_list ap)
const char *ptr;
ptr = acl_vstring_str(str);
len = ACL_VSTRING_LEN(str);
len = (int) ACL_VSTRING_LEN(str);
n = acl_vstream_write(astream->stream, ptr, len);
if (n == ACL_VSTREAM_EOF) {
if (acl_last_error() != ACL_EAGAIN) {
@ -385,13 +385,13 @@ void acl_aio_vfprintf(ACL_ASTREAM *astream, const char *fmt, va_list ap)
acl_assert(n >= 0);
len = ACL_VSTRING_LEN(str);
len = (int) ACL_VSTRING_LEN(str);
if (n < len)
acl_vstring_memmove(str, acl_vstring_str(str) + n, len - n);
/* 将数据置入该流的写队列中 */
acl_fifo_push(&astream->write_fifo, str);
astream->write_left += ACL_VSTRING_LEN(str);
astream->write_left += (int) ACL_VSTRING_LEN(str);
/* 将该流的写事件置入事件监控中 */
WRITE_SAFE_ENABLE(astream, __writen_notify_callback);
@ -465,7 +465,7 @@ void acl_aio_writev(ACL_ASTREAM *astream, const struct iovec *vector, int count)
for (i = 0; i < count; i++) {
if (n >= (int) vector[i].iov_len) {
/* written */
n -= vector[i].iov_len;
n -= (int) vector[i].iov_len;
} else {
/* partially written */
break;
@ -496,10 +496,10 @@ void acl_aio_writev(ACL_ASTREAM *astream, const struct iovec *vector, int count)
/* 计算剩余的数据总长度 */
j = i;
dlen = vector[i].iov_len - n;
dlen = (int) vector[i].iov_len - n;
i++; /* skipt this */
for (; i < count; i++) {
dlen += vector[i].iov_len;
dlen += (int) vector[i].iov_len;
}
/* 将数据置入该流的写队列中 */

View File

@ -19,7 +19,7 @@ struct ACL_AIO {
int rbuf_size;
int event_mode;
ACL_ARRAY *dead_streams;
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
int timer_active;
unsigned int tid;
#endif

View File

@ -125,5 +125,5 @@ int acl_base64_decode(const char *in, char **pptr_in)
}
*result = 0;
return (result - *pptr);
return (int) (result - *pptr);
}

View File

@ -123,7 +123,7 @@ int acl_html_decode(const char *in, ACL_VSTRING *out)
&ptr, NULL, NULL);
if (token == NULL) {
pre = markup_unescape(pre, out);
len = ptr - pre;
len = (int) (ptr - pre);
if (len > 0)
acl_vstring_memcat(out, pre, len);
break;
@ -131,7 +131,7 @@ int acl_html_decode(const char *in, ACL_VSTRING *out)
spec = (const HTML_SPEC*) token->ctx;
acl_assert(spec != NULL);
len = ptr - pre - spec->len;
len = (int) (ptr - pre - spec->len);
if (len > 0)
acl_vstring_memcat(out, pre, len);
if (spec->ch > 255)

View File

@ -19,7 +19,7 @@ char *acl_url_encode(const char *str)
register int i, j, len, tmp_len;
unsigned char *tmp;
len = strlen(str);
len = (int) strlen(str);
tmp_len = len;
tmp = (unsigned char*) acl_mymalloc(len+1);
if (tmp == NULL)
@ -71,7 +71,7 @@ char *acl_url_decode(const char *str)
char *tmp;
register int i, len, pos = 0;
len = strlen(str);
len = (int) strlen(str);
tmp = (char *) acl_mymalloc(len + 1);
if (tmp == NULL)
acl_msg_fatal("%s(%d): malloc error", myname, __LINE__);

View File

@ -160,7 +160,7 @@ int acl_xml_decode(const char *in, ACL_VSTRING *out)
token = acl_token_tree_match(__token_tree, &ptr, NULL, NULL);
if (token == NULL) {
pre = markup_unescape(pre, out);
len = ptr - pre;
len = (int) (ptr - pre);
if (len > 0)
acl_vstring_memcat(out, pre, len);
break;
@ -168,7 +168,7 @@ int acl_xml_decode(const char *in, ACL_VSTRING *out)
spec = (const XML_SPEC*) token->ctx;
acl_assert(spec != NULL);
len = ptr - pre - spec->len;
len = (int) (ptr - pre - spec->len);
if (len > 0)
acl_vstring_memcat(out, pre, len);
acl_vstring_strcat(out, spec->str);

View File

@ -41,7 +41,7 @@ int uni2utf8(unsigned int c, char *buf, size_t size)
if (buf && size > 0) {
if (len > size)
len = size;
len = (unsigned int) size;
for (i = len - 1; i > 0; --i) {
buf[i] = (c & 0x3f) | 0x80;
c >>= 6;

View File

@ -44,7 +44,7 @@ static ACL_MDT_IDX *mdt_idx_create(ACL_MDT *mdt, size_t init_capacity,
if ((flag & ACL_MDT_FLAG_KMR))
flag2 |= ACL_BINHASH_FLAG_KEY_REUSE;
idx->table = acl_binhash_create(init_capacity, flag2);
idx->table = acl_binhash_create((int) init_capacity, flag2);
idx->idx.name = acl_mystrdup(name);
idx->idx.flag = flag;
return ((ACL_MDT_IDX*) idx);
@ -73,7 +73,8 @@ static void mdt_idx_add(ACL_MDT_IDX *idx, const char *key, ACL_MDT_REC *rec)
ACL_MDT_IDX_BHASH *idx_bhash = (ACL_MDT_IDX_BHASH*) idx;
ACL_BINHASH_INFO *info;
info = acl_binhash_enter(idx_bhash->table, key, strlen(key) + 1, (char*) rec);
info = acl_binhash_enter(idx_bhash->table, key,
(int) strlen(key) + 1, (char*) rec);
if (info == NULL)
acl_msg_error("%s(%d): binhash_enter error, value(%s)",
myname, __LINE__, key);
@ -92,7 +93,8 @@ static ACL_MDT_REC *mdt_idx_get(ACL_MDT_IDX *idx, const char *key)
ACL_MDT_IDX_BHASH *idx_bhash = (ACL_MDT_IDX_BHASH*) idx;
ACL_MDT_REC *rec;
rec = (ACL_MDT_REC*) acl_binhash_find(idx_bhash->table, key, strlen(key) + 1);
rec = (ACL_MDT_REC*) acl_binhash_find(idx_bhash->table, key,
(int) strlen(key) + 1);
return (rec);
}
@ -108,7 +110,7 @@ static void mdt_idx_del(ACL_MDT_IDX *idx, const char *key)
/* idx->table 哈希表里存储的是: rec->key: rec 对,所以不需要在
* rec
*/
acl_binhash_delete(idx_bhash->table, key, strlen(key) + 1, NULL);
acl_binhash_delete(idx_bhash->table, key, (int) strlen(key) + 1, NULL);
}
/**

View File

@ -35,7 +35,7 @@ static ACL_MDT_IDX *mdt_idx_create(ACL_MDT *mdt acl_unused, size_t init_capacity
if ((flag & ACL_MDT_FLAG_KMR))
flag2 |= ACL_HTABLE_FLAG_KEY_REUSE;
idx->table = acl_htable_create(init_capacity, flag2);
idx->table = acl_htable_create((int) init_capacity, flag2);
idx->idx.name = acl_mystrdup(name);
idx->idx.flag = flag;
return ((ACL_MDT_IDX*) idx);

View File

@ -481,14 +481,14 @@ ACL_DB_POOL *acl_dbpool_mysql_create(const ACL_DB_INFO *db_info)
/*----------------------------------------------------------------------------*/
#if 0
#ifdef WIN32
#ifdef ACL_WINDOWS
/* XXX: just for the poor mysql */
extern void _dosmaperr(unsigned long error);
void _dosmaperr(unsigned long error)
{
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */
#endif
#endif /* HAS_MYSQL */

View File

@ -383,7 +383,7 @@ int zdb_update(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off_saved,
if (blk_off_saved == NULL) {
db->status |= ZDB_STAT_KEY_NEW; /* 设置状态位以表明当前为新值 */
ret = db->dat_add(db, key, dat, len);
ret = db->dat_add(db, key, dat, (int) len);
db->status &= ~ZDB_STAT_KEY_NEW; /* 清除标志位 */
} else {
db->status &=~ ZDB_STAT_KEY_NEW; /* 清除标志位表明是修改旧数据 */

View File

@ -1049,7 +1049,7 @@ int zdb_dat_update(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off,
}
/* 计算新的 inode 相对路径号 */
inode_new = dat_inode(db, len);
inode_new = dat_inode(db, (int) len);
if (inode_new < 0) {
acl_msg_error("%s(%d): inode(%d) invalid, dat len(%d)",
myname, __LINE__, inode_new, (int) len);
@ -1163,7 +1163,7 @@ int zdb_dat_update(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off,
/* 向另一个值存储中添加新记录 */
ret = zdb_dat_add(db, key, dat, len);
ret = zdb_dat_add(db, key, dat, (int) len);
RETURN (ret);
}

View File

@ -157,16 +157,19 @@ void zdb_io_cache_open(ZDB_STORE *store, size_t blk_len)
int page_size = 4096 * 10;
if ((int) blk_len >= page_size)
page_size = blk_len * 100;
page_size = (int) blk_len * 100;
io->store = store;
io->blk_len = blk_len;
avl_create(&io->blk_tree, cmp_fn, sizeof(ZDB_IO_BLK),
offsetof(ZDB_IO_BLK, node));
io->blk_cache = acl_cache_create(store->cache_max, store->cache_timeout, free_blk_cache);
io->blk_cache = acl_cache_create(store->cache_max,
store->cache_timeout, free_blk_cache);
if ((store->flag & STORE_FLAG_IO_SLICE)) {
io->blk_slice = acl_slice_create("blk_slice", 0, sizeof(ZDB_IO_BLK), flag);
io->dat_slice = acl_slice_create("dat_slice", page_size, blk_len, flag);
io->blk_slice = acl_slice_create("blk_slice", 0,
(int) sizeof(ZDB_IO_BLK), flag);
io->dat_slice = acl_slice_create("dat_slice",
page_size, (int) blk_len, flag);
} else {
io->blk_slice = NULL;
io->dat_slice = NULL;
@ -315,17 +318,17 @@ static int zdb_io_cache_write(ZDB_IO *io, const void *buf,
blk->dlen = len;
memcpy(blk->dat, buf, len); /* just override */
if ((blk->flag & BLK_F_DIRTY)) /* 说明已经在写缓存了 */
return (len);
return (int) (len);
/* 需要添加进写缓存 */
blk->flag |= BLK_F_DIRTY;
avl_add(&io->blk_tree, blk);
return (len);
return (int) (len);
}
/* 说明是新数据 */
zdb_io_cache_add(io, buf, len, off, 1);
return (len);
return (int) (len);
}
static int zdb_io_cache_read(ZDB_IO *io, void *buf,

View File

@ -155,7 +155,7 @@ ACL_EVENT *acl_event_new_kernel(int delay_sec, int delay_usec)
ACL_EVENT *eventp;
int fdsize;
/* 在 WIN32 下的 iocp 可以支撑更大的连接,默认设为 102400 个连接
/* 在 ACL_WINDOWS 下的 iocp 可以支撑更大的连接,默认设为 102400 个连接
*/
fdsize = 102400;
eventp = event_new_iocp(fdsize);

View File

@ -24,7 +24,7 @@ extern "C" {
* For now use FD_SETSIZE as defined along with the fd-set type.
*/
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
typedef struct IOCP_EVENT IOCP_EVENT;
#endif
@ -55,7 +55,7 @@ struct ACL_EVENT_FDTABLE {
int fdidx_ready;
ACL_RING delay_entry;
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
HANDLE h_iocp;
IOCP_EVENT *event_read;
IOCP_EVENT *event_write;

View File

@ -17,7 +17,7 @@ extern "C" {
#define ACL_EVENTS_STYLE_DEVPOLL 3
#define ACL_EVENTS_STYLE_KQUEUE 4
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
# if(_MSC_VER >= 1300)
# define ACL_EVENTS_STYLE_IOCP 5
# endif

View File

@ -776,7 +776,7 @@ TAG_DONE:
IOCP_EVENT *iocp_event = NULL;
isSuccess = GetQueuedCompletionStatus(ev->h_iocp,
&bytesTransferred, (DWORD*) &fdp,
&bytesTransferred, (PULONG_PTR) &fdp,
(OVERLAPPED**) &iocp_event, delay);
if (!isSuccess) {

View File

@ -413,7 +413,7 @@ static void event_loop(ACL_EVENT *eventp)
/* 调用 select 系统调用检测可用描述字 */
#ifdef WIN32
#ifdef ACL_WINDOWS
nready = select(0, &rmask, &wmask, &xmask, tvp);
#else
nready = select(eventp->maxfd + 1, &rmask, &wmask, &xmask, tvp);

View File

@ -399,7 +399,7 @@ static void event_loop(ACL_EVENT *eventp)
THREAD_UNLOCK(&event_thr->event.tb_mutex);
event_thr->event.blocked = 1;
nready = select(eventp->maxfd + 1, &rmask, &wmask, &xmask, tvp);
nready = select((int) eventp->maxfd + 1, &rmask, &wmask, &xmask, tvp);
event_thr->event.blocked = 0;
if (nready < 0) {

View File

@ -451,13 +451,13 @@ static void set_hwnd_event(HWND hWnd acl_unused, EVENT_WMSG *ev)
static EVENT_WMSG *get_hwnd_event(HWND hWnd)
{
EVENT_WMSG *ev = (EVENT_WMSG*) GetWindowLongPtr(hWnd, GWL_USERDATA);
EVENT_WMSG *ev = (EVENT_WMSG*) GetWindowLongPtr(hWnd, GWLP_USERDATA);
return ev;
}
static void set_hwnd_event(HWND hWnd, EVENT_WMSG *ev)
{
SetWindowLongPtr(hWnd, GWL_USERDATA, (LONG) ev);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG) ev);
}
#endif

View File

@ -13,12 +13,12 @@
#endif /* ACL_PREPARE_COMPILE */
#if defined(WIN32)
#if defined(ACL_WINDOWS)
#pragma comment(lib,"ws2_32")
#pragma comment(lib, "wsock32")
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
#include <Tlhelp32.h>
#endif
@ -33,7 +33,7 @@ const char *acl_version(void)
#ifdef ACL_UNIX
static acl_pthread_t acl_var_main_tid = (acl_pthread_t) -1;
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
static unsigned long acl_var_main_tid = (unsigned long) -1;
#else
#error "Unknown OS"
@ -52,7 +52,7 @@ void acl_init(void)
__have_inited = 1;
#ifdef ACL_UNIX
signal(SIGPIPE, SIG_IGN);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
acl_socket_init();
acl_vstream_init();
#endif
@ -70,7 +70,7 @@ void acl_end(void)
if (__have_ended)
return;
__have_ended = 1;
#if defined(WIN32)
#if defined(ACL_WINDOWS)
acl_socket_end();
acl_pthread_end();
#endif
@ -83,7 +83,7 @@ void acl_poll_prefered(int yesno)
__acl_var_use_poll = yesno;
}
#ifdef WIN32
#ifdef ACL_WINDOWS
static acl_pthread_once_t __once_control = ACL_PTHREAD_ONCE_INIT;
static void get_main_thread_id(void)
@ -113,7 +113,7 @@ unsigned long acl_main_thread_self()
{
#ifdef ACL_UNIX
return ((unsigned long) acl_var_main_tid);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (acl_var_main_tid == (unsigned long) -1)
acl_pthread_once(&__once_control, get_main_thread_id);
return (acl_var_main_tid);

View File

@ -17,18 +17,18 @@
#include <time.h>
#include <unistd.h>
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
#include <time.h>
#ifdef ACL_BCB_COMPILER
#pragma hdrstop
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
#pragma once
#endif
#endif /* defined(WIN32) */
#endif /* defined(ACL_WINDOWS) */
#include "stdlib/acl_sys_patch.h"
#include "thread/acl_thread.h"
@ -39,7 +39,7 @@
#endif
#undef __SET_ERRNO
#ifdef WIN32
#ifdef ACL_WINDOWS
# define __SET_ERRNO(_x_) (void) 0
#elif defined(ACL_UNIX)
# define __SET_ERRNO(_x_) (acl_set_error(_x_))

View File

@ -144,7 +144,7 @@ ACL_IFCONF *acl_get_ifaddrs()
return (ifconf);
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
#ifdef MS_VC6
@ -320,7 +320,7 @@ void acl_free_ifaddrs(ACL_IFCONF *ifconf)
if (ifconf == NULL)
return;
for (i = 0; i < ifconf->length; i++) {
#ifdef WIN32
#ifdef ACL_WINDOWS
if (ifconf->addrs[i].desc != NULL)
acl_myfree(ifconf->addrs[i].desc);
#endif

View File

@ -26,7 +26,7 @@
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
struct SOCK_ADDR {
union {
struct sockaddr_in in;
@ -57,7 +57,7 @@ int acl_getpeername(ACL_SOCKET sockfd, char *buf, size_t size)
if (getpeername(sockfd, sa, &len) == -1)
return -1;
#ifndef WIN32
#ifndef ACL_WINDOWS
if (sa->sa_family == AF_UNIX) {
memset(&addr, 0, sizeof(addr));
len = sizeof(addr);
@ -94,7 +94,7 @@ int acl_getsockname(ACL_SOCKET sockfd, char *buf, size_t size)
if (getsockname(sockfd, sa, &len) == -1)
return -1;
#ifndef WIN32
#ifndef ACL_WINDOWS
if (sa->sa_family == AF_UNIX) {
snprintf(buf, size, "%s", addr.sa.un.sun_path);
return 0;
@ -121,7 +121,7 @@ int acl_getsocktype(ACL_SOCKET sockfd)
if (getsockname(sockfd, sa, &len) == -1)
return -1;
#ifndef WIN32
#ifndef ACL_WINDOWS
if (sa->sa_family == AF_UNIX)
return AF_UNIX;
#endif

View File

@ -276,7 +276,7 @@ int acl_valid_ipv6_hostaddr(const char *addr, int gripe)
break;
default:
/* Advance by at least 1 character position or terminate. */
len = strspn((const char *) cp, "0123456789abcdefABCDEF");
len = (int) strspn((const char *) cp, "0123456789abcdefABCDEF");
if (len /* - strspn((char *) cp, "0") */ > 4) {
if (gripe)
acl_msg_warn("%s: malformed IPv6 address: %.100s",

View File

@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef WIN32
#ifdef ACL_WINDOWS
#include <io.h>
#include <fcntl.h>
#endif
@ -121,7 +121,7 @@ ACL_VSTREAM *acl_vstream_accept_ex(ACL_VSTREAM *listen_stream,
char buf[256];
if ((listen_stream->type & ACL_VSTREAM_TYPE_LISTEN_INET)) {
#ifdef WIN32
#ifdef ACL_WINDOWS
if (!(listen_stream->type & ACL_VSTREAM_TYPE_LISTEN_IOCP))
connfd = acl_inet_accept_ex(servfd, buf, sizeof(buf));
else if (listen_stream->iocp_sock == ACL_SOCKET_INVALID)
@ -207,7 +207,7 @@ ACL_VSTREAM *acl_vstream_connect_ex(const char *addr,
connfd = acl_inet_connect_ex(addr, block_mode,
connect_timeout, he_errorp);
}
#ifdef WIN32
#ifdef ACL_WINDOWS
else {
acl_msg_error("%s(%d): addr(%s) invalid",
myname, __LINE__, addr);
@ -259,7 +259,8 @@ static int udp_read(ACL_SOCKET fd, void *buf, size_t size,
memset(&sa, 0, sizeof(sa));
ret = recvfrom(fd, buf, size, 0, (struct sockaddr*) &sa, &sa_len);
ret = recvfrom(fd, buf, (int) size, 0,
(struct sockaddr*) &sa, &sa_len);
if (ret > 0 && memcmp(stream->sa_peer, &sa, sizeof(sa)) != 0)
acl_vstream_set_peer_addr(stream, &sa);
@ -276,8 +277,9 @@ static int udp_write(ACL_SOCKET fd, const void *buf, size_t size,
acl_msg_fatal("%s, %s(%d): peer addr null",
myname, __FILE__, __LINE__);
ret = sendto(fd, buf, size, 0, (struct sockaddr*) stream->sa_peer,
stream->sa_peer_len);
ret = sendto(fd, buf, (int) size, 0,
(struct sockaddr*) stream->sa_peer,
(int) stream->sa_peer_len);
return ret;
}
@ -318,7 +320,7 @@ ACL_VSTREAM *acl_vstream_bind(const char *addr, int rw_timeout)
sa.sin_port = htons(port);
sa.sin_addr.s_addr = inet_addr(host);
#ifdef WIN32
#ifdef ACL_WINDOWS
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
#else
sock = socket(AF_INET, SOCK_DGRAM, 0);

View File

@ -19,7 +19,7 @@
/* Utility library. */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "stdlib/acl_mystring.h"
#endif
@ -209,7 +209,7 @@ static ACL_SOCKET inet_connect_one(const char *ip, int port,
acl_set_error(err);
}
#ifdef WIN32
#ifdef ACL_WINDOWS
if (errno_saved == ACL_EINPROGRESS || errno_saved == ACL_EWOULDBLOCK)
return sock;
#elif defined(ACL_UNIX)

View File

@ -44,7 +44,7 @@ int acl_timed_connect(ACL_SOCKET sock, const struct sockaddr * sa,
#ifdef ACL_UNIX
if (errno != ACL_EINPROGRESS)
return (-1);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (errno != ACL_EINPROGRESS && errno != ACL_EWOULDBLOCK)
return (-1);
#endif

View File

@ -56,7 +56,7 @@ static int dns_read(ACL_SOCKET fd, void *buf, size_t size,
ret = recvfrom(fd, buf, size, 0,
(struct sockaddr*) &dns->addr_from.addr,
(socklen_t*) &dns->addr_from.addr_len);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
ret = recvfrom(fd, (char*) buf, (int) size, 0,
(struct sockaddr*) &dns->addr_from.addr,
&dns->addr_from.addr_len);
@ -94,7 +94,7 @@ static int dns_write(ACL_SOCKET fd, const void *buf, size_t size,
#ifdef ACL_UNIX
ret = sendto(fd, buf, size, 0,
(struct sockaddr*) &addr->addr, addr->addr_len);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
ret = sendto(fd, (const char*) buf, (int) size,
0, (struct sockaddr*) &addr->addr, addr->addr_len);
#else
@ -135,7 +135,7 @@ static ACL_DNS_DB *build_dns_db(const rfc1035_message *res, int count,
phost->saddr.sin_addr.s_addr =
*((in_addr_t*) res->answer[i].rdata);
# endif
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
phost->saddr.sin_addr.s_addr =
*((unsigned int*) res->answer[i].rdata);
#endif
@ -618,7 +618,7 @@ void acl_dns_add_group(ACL_DNS *dns, const char *group, const char *refer,
ACL_SAFE_STRNCPY(dmgrp->group, group, sizeof(dmgrp->group));
acl_lowercase(dmgrp->group);
dmgrp->group_len = strlen(dmgrp->group);
dmgrp->group_len = (int) strlen(dmgrp->group);
if (refer == NULL || *refer == 0)
ACL_SAFE_STRNCPY(dmgrp->domain, dmgrp->group, sizeof(dmgrp->domain));

View File

@ -394,7 +394,7 @@ ACL_DNS_DB *acl_gethostbyname(const char *name, int *h_error)
h_addrp = NULL;
#if defined(WIN32) || defined(ACL_MACOSX) || defined(MINGW)
#if defined(ACL_WINDOWS) || defined(ACL_MACOSX) || defined(MINGW)
h_addrp = gethostbyname(name);
if (h_addrp == NULL) {
acl_msg_error("%s, %s(%d): gethostbyname error(%s), addr=%s",

View File

@ -3,7 +3,7 @@
#include "stdlib/acl_define.h"
#include <stdio.h>
#ifdef WIN32
#ifdef ACL_WINDOWS
#include <io.h>
#endif
#ifdef ACL_UNIX

View File

@ -107,7 +107,7 @@ ACL_SOCKET acl_sane_accept(ACL_SOCKET sock, struct sockaddr * sa, socklen_t *len
ACL_SOCKET acl_accept(ACL_SOCKET sock, char *buf, size_t size, int* sock_type)
{
#ifdef WIN32
#ifdef ACL_WINDOWS
struct {
union {
struct sockaddr_in in;
@ -136,7 +136,7 @@ ACL_SOCKET acl_accept(ACL_SOCKET sock, char *buf, size_t size, int* sock_type)
if (buf != NULL && size > 0) {
size_t n;
#ifndef WIN32
#ifndef ACL_WINDOWS
if (sa->sa_family == AF_UNIX)
snprintf(buf, size, "%s", addr.sa.un.sun_path);
#endif

View File

@ -11,7 +11,7 @@
#include <fcntl.h>
#include <sys/stat.h> /* for S_IREAD */
#ifdef WIN32
#ifdef ACL_WINDOWS
# include <io.h>
#elif defined(ACL_UNIX)
# include <sys/types.h>
@ -75,7 +75,9 @@ static int __read_wait(ACL_SOCKET fd, int timeout)
tp = 0;
for (;;) {
switch (select(fd + 1, &read_fds, (fd_set *) 0, &except_fds, tp)) {
switch (select((int) fd + 1, &read_fds, (fd_set *) 0,
&except_fds, tp))
{
case -1:
if (acl_last_error() != ACL_EINTR)
return -1;
@ -383,7 +385,7 @@ TAG_AGAIN:
if (stream->type == ACL_VSTREAM_TYPE_FILE) {
if ((stream->oflags & O_APPEND)) {
#ifdef WIN32
#ifdef ACL_WINDOWS
stream->sys_offset = acl_lseek(
ACL_VSTREAM_FILE(stream), 0, SEEK_END);
if (stream->sys_offset < 0)
@ -438,7 +440,7 @@ static int __loop_writen(ACL_VSTREAM *stream, const void *vptr, size_t dlen)
ptr = (const unsigned char *) vptr;
while (dlen > 0) {
n = __vstream_sys_write(stream, ptr, dlen);
n = __vstream_sys_write(stream, ptr, (int) dlen);
if (n <= 0) {
if (acl_last_error() == ACL_EINTR
|| acl_last_error() == ACL_EAGAIN)
@ -452,7 +454,7 @@ static int __loop_writen(ACL_VSTREAM *stream, const void *vptr, size_t dlen)
ptr += n;
}
return (ptr - (const unsigned char *) vptr);
return (int) (ptr - (const unsigned char *) vptr);
}
int private_vstream_writen(ACL_VSTREAM *stream, const void *vptr, size_t dlen)
@ -468,7 +470,7 @@ int private_vstream_writen(ACL_VSTREAM *stream, const void *vptr, size_t dlen)
int private_vstream_write(ACL_VSTREAM *stream, const void *vptr, size_t dlen)
{
return (__vstream_sys_write(stream, vptr, dlen));
return (__vstream_sys_write(stream, vptr, (int) dlen));
}
int private_vstream_buffed_writen(ACL_VSTREAM *stream,
@ -487,7 +489,7 @@ int private_vstream_buffed_writen(ACL_VSTREAM *stream,
else if (__loop_writen(stream, vptr, dlen) == ACL_VSTREAM_EOF)
return (ACL_VSTREAM_EOF);
else
return (dlen);
return (int) (dlen);
} else if (dlen + (size_t) stream->wbuf_dlen >=
(size_t) stream->wbuf_size)
{
@ -496,8 +498,8 @@ int private_vstream_buffed_writen(ACL_VSTREAM *stream,
}
memcpy(stream->wbuf + (size_t) stream->wbuf_dlen, vptr, dlen);
stream->wbuf_dlen += dlen;
return(dlen);
stream->wbuf_dlen += (int) dlen;
return (int) (dlen);
}
int private_vstream_fflush(ACL_VSTREAM *stream)
@ -527,7 +529,7 @@ int private_vstream_fflush(ACL_VSTREAM *stream)
acl_assert(stream->wbuf_dlen >= 0);
return (ptr - stream->wbuf);
return (int) (ptr - stream->wbuf);
}
ACL_VSTREAM *private_vstream_fhopen(ACL_FILE_HANDLE fh, unsigned int oflags)
@ -576,10 +578,10 @@ ACL_VSTREAM *private_vstream_fdopen(ACL_SOCKET fd, unsigned int oflags,
if (fdtype == 0)
fdtype = ACL_VSTREAM_TYPE_SOCK;
stream->read_buf_len = buflen;
stream->read_buf_len = (int) buflen;
stream->type = fdtype;
ACL_VSTREAM_SOCK(stream) = fd;
#ifdef WIN32
#ifdef ACL_WINDOWS
stream->iocp_sock = ACL_SOCKET_INVALID;
#endif
@ -630,7 +632,7 @@ ACL_VSTREAM *private_vstream_fopen(const char *path, unsigned int oflags,
oflags |= O_LARGEFILE;
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
oflags |= O_BINARY;
#endif
@ -712,7 +714,7 @@ ACL_VSTREAM *private_vstream_connect_ex(const char *addr, int block_mode,
if (ptr)
fd = acl_inet_connect_ex(addr, ACL_BLOCKING,
conn_timeout, he_errorp);
#ifdef WIN32
#ifdef ACL_WINDOWS
else
return (NULL);
#elif defined(ACL_UNIX)

View File

@ -6,7 +6,7 @@
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
#include <windows.h>
@ -114,4 +114,4 @@ int sem_post(ACL_SEM *sem)
return 0;
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -7,7 +7,7 @@ extern "C" {
#endif
#include "stdlib/acl_define.h"
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
#include "thread/acl_sem.h"
ACL_SEM *sem_create2(const char *pathname, unsigned int initial_value);

View File

@ -7,7 +7,7 @@
#endif /* ACL_PREPARE_COMPILE */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "net/acl_net.h"
#include "thread/acl_thread.h"
@ -372,5 +372,5 @@ void acl_proctl_child(const char *progname acl_unused,
acl_msg_fatal("%s(%d): not support!", myname, __LINE__);
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -5,7 +5,7 @@
#endif /* ACL_PREPARE_COMPILE */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "stdlib/acl_stdlib.h"
#include "net/acl_net.h"
@ -164,5 +164,5 @@ void *proctl_child_thread(void *arg)
return (NULL);
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -3,7 +3,7 @@
#include "stdlib/acl_define.h"
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
#include "stdlib/acl_stdlib.h"
#ifdef __cplusplus

View File

@ -5,7 +5,7 @@
#endif /* ACL_PREPARE_COMPILE */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "stdlib/acl_stdlib.h"
#include "net/acl_net.h"
#include <stdarg.h>
@ -332,5 +332,5 @@ void *proctl_monitor_thread(void *arg)
return (NULL);
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -5,7 +5,7 @@
#endif /* ACL_PREPARE_COMPILE */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "stdlib/acl_stdlib.h"
#include "thread/acl_thread.h"
@ -461,4 +461,4 @@ int proctl_service_join(void)
return (0);
}
#endif /*WIN32 */
#endif /*ACL_WINDOWS */

View File

@ -5,7 +5,7 @@
#endif /* ACL_PREPARE_COMPILE */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "stdlib/acl_stdlib.h"
#include "net/acl_net.h"
#include <windows.h>
@ -131,4 +131,4 @@ ACL_VSTREAM *local_listen()
return sstream;
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -161,7 +161,7 @@ const char *acl_chain_data(ACL_CHAIN *chain)
int acl_chain_data_len(ACL_CHAIN *chain)
{
return (ACL_VSTRING_LEN(&chain->sbuf));
return (int) (ACL_VSTRING_LEN(&chain->sbuf));
}
int acl_chain_size(ACL_CHAIN *chain)

View File

@ -18,7 +18,7 @@ ACL_FILE *acl_fopen(const char *filename, const char *mode)
ACL_FILE *fp;
ACL_VSTREAM *stream;
int oflags = 0, whileflag;
#ifdef WIN32
#ifdef ACL_WINDOWS
int commodeset = 0, scanset = 0;
#endif
@ -67,14 +67,14 @@ ACL_FILE *acl_fopen(const char *filename, const char *mode)
}
break;
case 'b':
#ifdef WIN32
#ifdef ACL_WINDOWS
if (oflags & (O_TEXT | O_BINARY))
whileflag = 0;
else
oflags |= O_BINARY;
#endif
break;
#ifdef WIN32
#ifdef ACL_WINDOWS
case 't':
if (oflags & (O_TEXT | O_BINARY))
whileflag = 0;
@ -126,7 +126,7 @@ ACL_FILE *acl_fopen(const char *filename, const char *mode)
case 'N':
oflags |= O_NOINHERIT;
break;
#endif /* WIN32 */
#endif /* ACL_WINDOWS */
default:
errno = EINVAL;
acl_msg_error("Invalid file open mode");
@ -182,7 +182,7 @@ size_t acl_fread(void *buf, size_t size, size_t nitems, ACL_FILE *fp)
return EOF;
}
ret /= size;
ret /= (int) size;
if (ret == (int) nitems)
return (nitems);
else if (ret == 0) {

View File

@ -470,7 +470,7 @@ void acl_msg_panic2(const char *fmt, va_list ap)
const char *acl_strerror(unsigned int errnum, char *buffer, int size)
{
const char *myname = "acl_strerror";
#ifdef WIN32
#ifdef ACL_WINDOWS
int L;
if (buffer == NULL || size <= 0) {
@ -560,7 +560,7 @@ const char *acl_last_serror(void)
int acl_last_error(void)
{
#ifdef WIN32
#ifdef ACL_WINDOWS
int error;
error = WSAGetLastError();
@ -573,7 +573,7 @@ int acl_last_error(void)
void acl_set_error(int errnum)
{
#ifdef WIN32
#ifdef ACL_WINDOWS
WSASetLastError(errnum);
#endif
errno = errnum;

View File

@ -105,7 +105,7 @@ int acl_myflock(ACL_FILE_HANDLE fd, int lock_style, int operation)
}
#endif /* ACL_UNIX */
#ifdef WIN32
#ifdef ACL_WINDOWS
# ifdef USE_LOCK_FILE
/* use LockFile/UnlockFile */
int acl_myflock(ACL_FILE_HANDLE fd, int lock_style acl_unused, int operation)

View File

@ -7,9 +7,9 @@
#include <stdio.h>
#include <sys/stat.h>
#ifdef WIN32
#ifdef ACL_WINDOWS
# include <process.h>
# ifdef WIN32
# ifdef ACL_WINDOWS
/* #include <io.h> */
# include <fcntl.h>
# include <sys/stat.h>
@ -76,7 +76,7 @@ struct ACL_LOG {
time_t reopen_inter; /**< 日志重新打开的最小时间间隔 */
};
#ifdef WIN32
#ifdef ACL_WINDOWS
# define strdup _strdup
#endif
@ -128,7 +128,7 @@ void acl_log_fp_set(ACL_VSTREAM *fp, const char *logpre)
static int open_file_log(const char *filename, const char *logpre)
{
const char *myname = "open_file_log";
#ifdef WIN32
#ifdef ACL_WINDOWS
int flag = O_RDWR | O_CREAT | O_APPEND | O_BINARY;
#else
int flag = O_RDWR | O_CREAT | O_APPEND;
@ -290,7 +290,7 @@ static int udp_read(ACL_SOCKET fd, void *buf, size_t size,
#ifdef ACL_UNIX
ret = recvfrom(fd, buf, size, 0, (struct sockaddr*) &log->from,
(socklen_t*) &log->from_len);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
ret = recvfrom(fd, (char*) buf, (int) size, 0,
(struct sockaddr*) &log->from, &log->from_len);
#else
@ -308,7 +308,7 @@ static int udp_write(ACL_SOCKET fd, const void *buf, size_t size,
#ifdef ACL_UNIX
ret = sendto(fd, buf, size, 0, (struct sockaddr*) &log->dest,
sizeof(log->dest));
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
ret = sendto(fd, (const char*) buf, (int) size, 0,
(struct sockaddr*) &log->dest, sizeof(log->dest));
#else
@ -470,7 +470,7 @@ void acl_logtime_fmt(char *buf, size_t size)
(void) time (&now);
(void) localtime_r(&now, &local_time);
strftime(buf, size, "%Y/%m/%d %H:%M:%S", &local_time);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
struct tm *local_time;
(void) time (&now);
@ -584,7 +584,7 @@ static void file_vsyslog(ACL_LOG *log, const char *info, const char *fmt, va_lis
snprintf(tbuf, sizeof(tbuf), "%s %s (pid=%d, tid=%d)(%s): ",
fmtstr, log->logpre, (int) getpid(),
(int) acl_pthread_self(), info);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
snprintf(tbuf, sizeof(tbuf), "%s %s (pid=%d, tid=%d)(%s): ",
fmtstr, log->logpre, (int) _getpid(),
(int) acl_pthread_self(), info);
@ -596,7 +596,7 @@ static void file_vsyslog(ACL_LOG *log, const char *info, const char *fmt, va_lis
#if defined(SUNOS5)
snprintf(tbuf, sizeof(tbuf), "%s %s (pid=%d)(%s): ",
fmtstr, log->logpre, (int) getpid(), info);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
snprintf(tbuf, sizeof(tbuf), "%s %s (pid=%d)(%s): ",
fmtstr, log->logpre, (int) _getpid(), info);
#else
@ -641,7 +641,7 @@ static void net_vsyslog(ACL_LOG *log, const char *info, const char *fmt, va_list
snprintf(tbuf, sizeof(tbuf), " %s (pid=%d, tid=%d)(%s): ",
log->logpre, (int) getpid(),
(int) acl_pthread_self(), info);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
snprintf(tbuf, sizeof(tbuf), " %s (pid=%d, tid=%d)(%s): ",
log->logpre, (int) _getpid(),
(int) acl_pthread_self(), info);
@ -652,7 +652,7 @@ static void net_vsyslog(ACL_LOG *log, const char *info, const char *fmt, va_list
#if defined(SUNOS5)
snprintf(tbuf, sizeof(tbuf), " %s (pid=%d)(%s): ",
log->logpre, (int) getpid(), info);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
snprintf(tbuf, sizeof(tbuf), " %s (pid=%d)(%s): ",
log->logpre, (int) _getpid(), info);
#else

View File

@ -130,7 +130,7 @@ ACL_VBUF *acl_vbuf_print(ACL_VBUF *bp, const char *format, va_list ap)
if (*cp == '*') { /* dynamic field width */
width = va_arg(ap, int);
sprintf(fmt + i, "%d", width);
i = strlen(fmt); /* reset i to string length */
i = (int) strlen(fmt); /* reset i to string length */
cp++;
} else { /* hard-coded field width */
for (width = 0; ACL_ISDIGIT(ch = *cp); cp++) {
@ -144,7 +144,7 @@ ACL_VBUF *acl_vbuf_print(ACL_VBUF *bp, const char *format, va_list ap)
if (*cp == '*') { /* dynamic precision */
prec = va_arg(ap, int);
sprintf(fmt + i, "%d", prec);
i = strlen(fmt); /* reset i to string length */
i = (int) strlen(fmt); /* reset i to string length */
cp++;
} else { /* hard-coded precision */
for (prec = 0; ACL_ISDIGIT(ch = *cp); cp++) {
@ -153,7 +153,7 @@ ACL_VBUF *acl_vbuf_print(ACL_VBUF *bp, const char *format, va_list ap)
CHECK_OVERFLOW(i, MAX_LEN);
}
}
#ifdef WIN32
#ifdef ACL_WINDOWS
if (*cp == 'l') {
if (*(cp + 1) == 'l') {
fmt[i++] = 'I';

View File

@ -250,7 +250,7 @@ int acl_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
if (!s)
s = "<NULL>";
len = acl_strnlen(s, precision);
len = (int) acl_strnlen(s, precision);
if (!(flags & LEFT)) {
while (len < field_width--) {
@ -287,13 +287,13 @@ int acl_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
* What does C99 say about the overflow case here? */
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
*ip = (str - buf);
*ip = (long) (str - buf);
} else if (qualifier == 'Z') {
size_t * ip = va_arg(args, size_t *);
*ip = (str - buf);
} else {
int * ip = va_arg(args, int *);
*ip = (str - buf);
*ip = (int) (str - buf);
}
continue;
@ -340,7 +340,7 @@ int acl_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
if (flags & SIGN)
num = (signed long) num;
} else if (qualifier == 'Z') {
num = va_arg(args, size_t);
num = (long) va_arg(args, size_t);
} else if (qualifier == 'h') {
num = (unsigned short) va_arg(args, int);
if (flags & SIGN)
@ -361,7 +361,7 @@ int acl_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
/* the trailing null byte doesn't count towards the total
* ++str;
*/
return str-buf;
return (int) (str - buf);
}
/**

View File

@ -11,7 +11,7 @@
#include <fcntl.h>
#include <sys/stat.h> /* for S_IREAD */
#ifdef WIN32
#ifdef ACL_WINDOWS
# include <io.h>
#elif defined(ACL_UNIX)
# include <sys/types.h>
@ -58,7 +58,7 @@ ACL_VSTREAM acl_vstream_fstd[] = {
{
#ifdef ACL_UNIX
{ STDIN_FILENO }, /* h_file */
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
-1, /* h_file */
#endif
0, /* is_nonblock */
@ -105,7 +105,7 @@ ACL_VSTREAM acl_vstream_fstd[] = {
0, /* oflags */
0, /* nrefer */
0, /* pid */
#ifdef WIN32
#ifdef ACL_WINDOWS
NULL, /* hproc */
ACL_SOCKET_INVALID, /* iocp_sock */
#endif
@ -115,7 +115,7 @@ ACL_VSTREAM acl_vstream_fstd[] = {
{
#ifdef ACL_UNIX
{ STDOUT_FILENO }, /* h_file */
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
-1, /* h_file */
#endif
0, /* is_nonblock */
@ -162,7 +162,7 @@ ACL_VSTREAM acl_vstream_fstd[] = {
0, /* oflags */
0, /* nrefer */
0, /* pid */
#ifdef WIN32
#ifdef ACL_WINDOWS
NULL, /* hproc */
ACL_SOCKET_INVALID, /* iocp_sock */
#endif
@ -171,7 +171,7 @@ ACL_VSTREAM acl_vstream_fstd[] = {
{
#ifdef ACL_UNIX
{ STDERR_FILENO }, /* h_file */
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
-1, /* h_file */
#endif
0, /* is_nonblock */
@ -218,7 +218,7 @@ ACL_VSTREAM acl_vstream_fstd[] = {
0, /* oflags */
0, /* nrefer */
0, /* pid */
#ifdef WIN32
#ifdef ACL_WINDOWS
NULL, /* hproc */
ACL_SOCKET_INVALID, /* iocp_sock */
#endif
@ -237,7 +237,7 @@ void acl_vstream_init()
return;
__called = 1;
#ifdef WIN32
#ifdef ACL_WINDOWS
# if 0
ACL_VSTREAM_IN->fd.h_file = (HANDLE) _get_osfhandle(_fileno(stdin));
ACL_VSTREAM_OUT->fd.h_file = (HANDLE) _get_osfhandle(_fileno(stdout));
@ -418,7 +418,7 @@ int acl_vstream_nonb_readn(ACL_VSTREAM *fp, char *buf, int size)
return ACL_VSTREAM_EOF;
}
acl_non_blocking(ACL_VSTREAM_SOCK(fp), 1);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (fp->type != ACL_VSTREAM_TYPE_FILE)
acl_non_blocking(ACL_VSTREAM_SOCK(fp), 1);
#endif
@ -444,13 +444,13 @@ int acl_vstream_nonb_readn(ACL_VSTREAM *fp, char *buf, int size)
return ACL_VSTREAM_EOF;
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (fp->is_nonblock == 0 && fp->type != ACL_VSTREAM_TYPE_FILE)
acl_non_blocking(ACL_VSTREAM_SOCK(fp), ACL_BLOCKING);
#endif
if (read_cnt < 0) {
#ifdef WIN32
#ifdef ACL_WINDOWS
if (fp->errnum == ACL_EWOULDBLOCK)
#elif defined(ACL_UNIX)
if (fp->errnum == ACL_EWOULDBLOCK
@ -508,7 +508,7 @@ int acl_vstream_probe_status(ACL_VSTREAM *fp)
return -1;
}
acl_non_blocking(ACL_VSTREAM_SOCK(fp), 1);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (fp->type != ACL_VSTREAM_TYPE_FILE)
acl_non_blocking(ACL_VSTREAM_SOCK(fp), 1);
#endif
@ -535,13 +535,13 @@ int acl_vstream_probe_status(ACL_VSTREAM *fp)
return -1;
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (fp->is_nonblock == 0 && fp->type != ACL_VSTREAM_TYPE_FILE)
acl_non_blocking(ACL_VSTREAM_SOCK(fp), ACL_BLOCKING);
#endif
if (ch == ACL_VSTREAM_EOF) {
#ifdef WIN32
#ifdef ACL_WINDOWS
if (fp->errnum == ACL_EWOULDBLOCK)
#elif defined(ACL_UNIX)
if (fp->errnum == ACL_EWOULDBLOCK || fp->errnum == ACL_EAGAIN)
@ -593,7 +593,7 @@ static void *__vstream_memmove(ACL_VSTREAM *fp, size_t n)
int acl_vstream_unread(ACL_VSTREAM *fp, const void *ptr, size_t length)
{
size_t capacity = fp->read_ptr - fp->read_buf;
ssize_t k = capacity - length;
ssize_t k = (ssize_t) (capacity - length);
/* 如果读缓冲中前部分空间不足, 则需要调整数据位置或扩充读缓冲区空间 */
@ -611,7 +611,7 @@ int acl_vstream_unread(ACL_VSTREAM *fp, const void *ptr, size_t length)
memcpy(fp->read_buf, ptr, length);
fp->read_ptr = fp->read_buf;
fp->read_cnt += length;
fp->read_cnt += (int) length;
fp->offset = 0;
return (int) length;
}
@ -620,7 +620,7 @@ int acl_vstream_unread(ACL_VSTREAM *fp, const void *ptr, size_t length)
n = min_delta * ((n + min_delta - 1) / min_delta);
acl_assert(n > 0);
fp->read_buf_len += n;
fp->read_buf_len += (int) n;
pbuf = acl_mymalloc((size_t) fp->read_buf_len);
memcpy(pbuf, ptr, length);
@ -631,14 +631,14 @@ int acl_vstream_unread(ACL_VSTREAM *fp, const void *ptr, size_t length)
fp->read_buf = pbuf;
fp->read_ptr = fp->read_buf;
fp->read_cnt += length;
fp->read_cnt += (int) length;
fp->offset = 0;
return (int) length;
}
fp->read_ptr -= length;
memcpy(fp->read_ptr, ptr, length);
fp->read_cnt += length;
fp->read_cnt += (int) length;
fp->offset -= length;
return (int) length;
}
@ -866,7 +866,7 @@ int acl_vstream_readn(ACL_VSTREAM *fp, void *buf, size_t size)
ptr += n;
size -= n;
if (size == 0)
return size_saved;
return (int) size_saved;
}
/* 为减少 read 次数,当输入缓冲区较小时,则自动启用双缓冲读方式 */
@ -889,7 +889,7 @@ int acl_vstream_readn(ACL_VSTREAM *fp, void *buf, size_t size)
}
}
return size_saved;
return (int) size_saved;
}
int acl_vstream_read(ACL_VSTREAM *fp, void *buf, size_t size)
@ -971,7 +971,7 @@ int acl_vstream_gets_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
myname, __FILE__, __LINE__);
*ready = 0;
n = LEN(buf);
n = (int) LEN(buf);
if (fp->read_cnt < 0)
acl_msg_fatal("%s, %s(%d): read_cnt(%d) < 0",
@ -980,7 +980,7 @@ int acl_vstream_gets_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
if (fp->read_cnt > 0) {
bfgets_crlf_peek(fp, buf, ready);
if (*ready)
return LEN(buf) - n;
return (int) LEN(buf) - n;
}
/* XXX: 调用者通过检查 *ready 值来判断是否读够数据, 系统IO读操作出错
@ -990,14 +990,14 @@ int acl_vstream_gets_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
if (fp->sys_read_ready) {
if (read_once(fp) <= 0) {
n = LEN(buf) - n;
n = (int) LEN(buf) - n;
return n > 0 ? n : ACL_VSTREAM_EOF;
}
}
if (fp->read_cnt > 0)
bfgets_crlf_peek(fp, buf, ready);
return LEN(buf) - n;
return (int) LEN(buf) - n;
}
static int bfgets_no_crlf_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
@ -1008,7 +1008,7 @@ static int bfgets_no_crlf_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
return ch;
if (ch == '\n') {
int n = LEN(buf) - 1;
int n = (int) LEN(buf) - 1;
while (n >= 0) {
ch = acl_vstring_charat(buf, n);
@ -1038,7 +1038,7 @@ int acl_vstream_gets_nonl_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
myname, __FILE__, __LINE__);
*ready = 0;
n = LEN(buf);
n = (int) LEN(buf);
if (fp->read_cnt < 0)
acl_msg_fatal("%s, %s(%d): read_cnt(=%d) < 0",
@ -1047,7 +1047,7 @@ int acl_vstream_gets_nonl_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
if (fp->read_cnt > 0) {
bfgets_no_crlf_peek(fp, buf, ready);
if (*ready)
return LEN(buf) - n;
return (int) LEN(buf) - n;
}
/* XXX: 调用者通过检查 *ready 值来判断是否读够数据, 系统IO读操作出错
@ -1057,7 +1057,7 @@ int acl_vstream_gets_nonl_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
if (fp->sys_read_ready) {
if (read_once(fp) <= 0) {
n = LEN(buf) - n;
n = (int) LEN(buf) - n;
return n > 0 ? n : ACL_VSTREAM_EOF;
}
@ -1066,7 +1066,7 @@ int acl_vstream_gets_nonl_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf, int *ready)
if (fp->read_cnt > 0)
bfgets_no_crlf_peek(fp, buf, ready);
return LEN(buf) - n;
return (int) LEN(buf) - n;
}
static int bfread_cnt_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf,
@ -1154,7 +1154,7 @@ int acl_vstream_read_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf)
acl_msg_fatal("%s, %s(%d): invalid input",
myname, __FILE__, __LINE__);
n = LEN(buf);
n = (int) LEN(buf);
if (fp->read_cnt < 0)
acl_msg_fatal("%s, %s(%d): read_cnt(=%d) < 0",
@ -1169,14 +1169,14 @@ int acl_vstream_read_peek(ACL_VSTREAM *fp, ACL_VSTRING *buf)
if (fp->sys_read_ready) {
if (read_once(fp) <= 0) {
n = LEN(buf) - n;
n = (int) LEN(buf) - n;
return n > 0 ? n : ACL_VSTREAM_EOF;
}
}
if (fp->read_cnt > 0)
bfread_peek(fp, buf);
return LEN(buf) - n;
return (int) LEN(buf) - n;
}
int acl_vstream_can_read(ACL_VSTREAM *fp)
@ -1244,7 +1244,7 @@ TAG_AGAIN:
if (fp->type == ACL_VSTREAM_TYPE_FILE) {
if ((fp->oflags & O_APPEND)) {
#ifdef WIN32
#ifdef ACL_WINDOWS
fp->sys_offset = acl_lseek(
ACL_VSTREAM_FILE(fp), 0, SEEK_END);
if (fp->sys_offset < 0) {
@ -1347,7 +1347,7 @@ TAG_AGAIN:
if (fp->type == ACL_VSTREAM_TYPE_FILE) {
if ((fp->oflags & O_APPEND)) {
#ifdef WIN32
#ifdef ACL_WINDOWS
fp->sys_offset = acl_lseek(
ACL_VSTREAM_FILE(fp), 0, SEEK_END);
if (fp->sys_offset < 0) {
@ -1483,7 +1483,7 @@ int acl_vstream_writevn(ACL_VSTREAM *fp, const struct iovec *vec, int count)
for (i = 0; i < count; i++) {
if (n >= (int) vect[i].iov_len) {
/* written */
n -= vect[i].iov_len;
n -= (int) vect[i].iov_len;
k++;
} else {
/* partially written */
@ -1525,7 +1525,7 @@ int acl_vstream_vfprintf(ACL_VSTREAM *fp, const char *fmt, va_list ap)
acl_msg_fatal("%s, %s(%d): vsprintf return null",
myname, __FILE__, __LINE__);
n = LEN(buf);
n = (int) LEN(buf);
if (n <= 0)
acl_msg_fatal("%s, %s(%d): len(%d) <= 0",
myname, __FILE__, __LINE__, n);
@ -1653,7 +1653,7 @@ static int loop_writen(ACL_VSTREAM *fp, const void *vptr, size_t size)
return ACL_VSTREAM_EOF;
}
return ptr - (const unsigned char *) vptr;
return (int) (ptr - (const unsigned char *) vptr);
}
int acl_vstream_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen)
@ -1684,7 +1684,7 @@ int acl_vstream_buffed_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen)
else if (loop_writen(fp, vptr, dlen) == ACL_VSTREAM_EOF)
return ACL_VSTREAM_EOF;
else
return dlen;
return (int) dlen;
} else if (dlen + (size_t) fp->wbuf_dlen >=
(size_t) fp->wbuf_size)
{
@ -1694,7 +1694,7 @@ int acl_vstream_buffed_writen(ACL_VSTREAM *fp, const void *vptr, size_t dlen)
memcpy(fp->wbuf + (size_t) fp->wbuf_dlen, vptr, dlen);
fp->wbuf_dlen += (int) dlen;
return dlen;
return (int) dlen;
}
int acl_vstream_buffed_vfprintf(ACL_VSTREAM *fp, const char *fmt, va_list ap)
@ -1719,7 +1719,7 @@ int acl_vstream_buffed_vfprintf(ACL_VSTREAM *fp, const char *fmt, va_list ap)
acl_msg_fatal("%s, %s(%d): vsprintf return null",
myname, __FILE__, __LINE__);
n = LEN(buf);
n = (int) LEN(buf);
if (n <= 0)
acl_msg_fatal("%s, %s(%d): len(%d) <= 0",
myname, __FILE__, __LINE__, n);
@ -1952,10 +1952,10 @@ ACL_VSTREAM *acl_vstream_fdopen(ACL_SOCKET fd, unsigned int oflags,
myname, __LINE__);
}
fp->read_buf_len = buflen;
fp->read_buf_len = (int) buflen;
fp->type = fdtype;
ACL_VSTREAM_SOCK(fp) = fd;
#ifdef WIN32
#ifdef ACL_WINDOWS
fp->iocp_sock = ACL_SOCKET_INVALID;
#endif
fp->read_ptr = fp->read_buf;
@ -2086,7 +2086,7 @@ ACL_VSTREAM *acl_vstream_fopen(const char *path, unsigned int oflags,
oflags |= O_LARGEFILE;
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
oflags |= O_BINARY;
#endif
@ -2114,7 +2114,7 @@ char *acl_vstream_loadfile2(const char *path, ssize_t *size)
{
const char *myname = "acl_vstream_loadfile";
ACL_VSTREAM *fp;
#ifdef WIN32
#ifdef ACL_WINDOWS
int oflags = O_RDONLY | O_BINARY;
#else
int oflags = O_RDONLY;
@ -2404,7 +2404,7 @@ acl_off_t acl_vstream_ftell(ACL_VSTREAM *fp)
return fp->offset - fp->read_cnt;
}
#ifdef WIN32
#ifdef ACL_WINDOWS
int acl_file_ftruncate(ACL_VSTREAM *fp, acl_off_t length)
{
const char *myname = "acl_file_ftruncate";
@ -2412,11 +2412,11 @@ int acl_file_ftruncate(ACL_VSTREAM *fp, acl_off_t length)
/* 参见C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src
* osfinfo.c
* _open_osfhandle: WIN32 API的文件句柄转换为标准C的文件句柄
* _get_osfhandle: C文件句柄查询WIN32 API文件句柄
* _open_osfhandle: ACL_WINDOWS API的文件句柄转换为标准C的文件句柄
* _get_osfhandle: C文件句柄查询ACL_WINDOWS API文件句柄
* _free_osfhnd: _open_osfhandle C文件句柄的资源
* WIN32 API句柄
* WIN32 API文件句柄进行关闭
* ACL_WINDOWS API句柄
* ACL_WINDOWS API文件句柄进行关闭
* close.c
* _close: C的文件句柄
*/
@ -2476,7 +2476,7 @@ int acl_file_truncate(const char *path, acl_off_t length)
return truncate(path, length);
}
#endif /* !WIN32, ACL_UNIX */
#endif /* !ACL_WINDOWS, ACL_UNIX */
int acl_vstream_fstat(ACL_VSTREAM *fp, struct acl_stat *buf)
{

View File

@ -251,7 +251,7 @@ int acl_vstream_pclose(ACL_VSTREAM *fp)
WEXITSTATUS(wait_status);
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
#include <process.h>
#include "stdlib/acl_mymalloc.h"
@ -410,4 +410,4 @@ int acl_vstream_pclose(ACL_VSTREAM *fp)
return -1;
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -31,7 +31,7 @@
static void vstring_extend(ACL_VBUF *bp, int incr)
{
const char *myname = "vstring_extend";
unsigned used = bp->ptr - bp->data;
unsigned used = (unsigned) (bp->ptr - bp->data);
int new_len;
ACL_VSTRING *vp = (ACL_VSTRING *) bp->ctx;
@ -110,7 +110,7 @@ void acl_vstring_init(ACL_VSTRING *vp, size_t len)
vp->vbuf.data = (unsigned char *) acl_mymalloc(len);
vp->vbuf.flags = 0;
vp->vbuf.len = len;
vp->vbuf.len = (int) len;
ACL_VSTRING_RESET(vp);
vp->vbuf.data[0] = 0;
vp->vbuf.get_ready = vstring_buf_get_ready;
@ -161,7 +161,7 @@ ACL_VSTRING *acl_vstring_slice_alloc(ACL_SLICE_POOL *slice, size_t len)
}
vp->vbuf.flags = 0;
vp->vbuf.len = len;
vp->vbuf.len = (int) len;
ACL_VSTRING_RESET(vp);
vp->vbuf.data[0] = 0;
vp->vbuf.get_ready = vstring_buf_get_ready;
@ -191,7 +191,7 @@ ACL_VSTRING *acl_vstring_dbuf_alloc(ACL_DBUF_POOL *dbuf, size_t len)
}
vp->vbuf.flags = 0;
vp->vbuf.len = len;
vp->vbuf.len = (int) len;
ACL_VSTRING_RESET(vp);
vp->vbuf.data[0] = 0;
vp->vbuf.get_ready = vstring_buf_get_ready;
@ -246,7 +246,7 @@ void acl_vstring_ctl(ACL_VSTRING *vp,...)
ACL_VSTRING *acl_vstring_truncate(ACL_VSTRING *vp, size_t len)
{
if (len < ACL_VSTRING_LEN(vp)) {
ACL_VSTRING_AT_OFFSET(vp, len);
ACL_VSTRING_AT_OFFSET(vp, (int) len);
ACL_VSTRING_TERMINATE(vp);
}
return (vp);
@ -310,9 +310,9 @@ ACL_VSTRING *acl_vstring_memcpy(ACL_VSTRING *vp, const char *src, size_t len)
{
ACL_VSTRING_RESET(vp);
ACL_VSTRING_SPACE(vp, len);
ACL_VSTRING_SPACE(vp, (int) len);
memcpy(acl_vstring_str(vp), src, len);
ACL_VSTRING_AT_OFFSET(vp, len);
ACL_VSTRING_AT_OFFSET(vp, (int) len);
ACL_VSTRING_TERMINATE(vp);
return (vp);
}
@ -326,7 +326,7 @@ ACL_VSTRING *acl_vstring_memmove(ACL_VSTRING *vp, const char *src, size_t len)
{
/* 说明是同一内存区间的数据移动 */
memmove(acl_vstring_str(vp), src, len);
ACL_VSTRING_AT_OFFSET(vp, len);
ACL_VSTRING_AT_OFFSET(vp, (int) len);
ACL_VSTRING_TERMINATE(vp);
return (vp);
} else {
@ -336,8 +336,8 @@ ACL_VSTRING *acl_vstring_memmove(ACL_VSTRING *vp, const char *src, size_t len)
memcpy(ptr, src, len);
acl_myfree(vp->vbuf.data);
vp->vbuf.data = (unsigned char *) ptr;
vp->vbuf.len = len;
ACL_VSTRING_AT_OFFSET(vp, len);
vp->vbuf.len = (int) len;
ACL_VSTRING_AT_OFFSET(vp, (int) len);
ACL_VSTRING_TERMINATE(vp);
vp->maxlen = 0;
return (vp);
@ -348,10 +348,10 @@ ACL_VSTRING *acl_vstring_memmove(ACL_VSTRING *vp, const char *src, size_t len)
ACL_VSTRING *acl_vstring_memcat(ACL_VSTRING *vp, const char *src, size_t len)
{
ACL_VSTRING_SPACE(vp, len);
ACL_VSTRING_SPACE(vp, (int) len);
memcpy(acl_vstring_end(vp), src, len);
len += ACL_VSTRING_LEN(vp);
ACL_VSTRING_AT_OFFSET(vp, len);
ACL_VSTRING_AT_OFFSET(vp, (int) len);
ACL_VSTRING_TERMINATE(vp);
return (vp);
}
@ -513,12 +513,12 @@ ACL_VSTRING *acl_vstring_insert(ACL_VSTRING *vp, size_t start,
* Move the existing content and copy the new content.
*/
new_len = ACL_VSTRING_LEN(vp) + len;
ACL_VSTRING_SPACE(vp, len);
ACL_VSTRING_SPACE(vp, (int) len);
memmove(acl_vstring_str(vp) + start + len,
acl_vstring_str(vp) + start,
ACL_VSTRING_LEN(vp) - start);
memcpy(acl_vstring_str(vp) + start, buf, len);
ACL_VSTRING_AT_OFFSET(vp, new_len);
ACL_VSTRING_AT_OFFSET(vp, (int) new_len);
ACL_VSTRING_TERMINATE(vp);
return (vp);
}
@ -532,8 +532,8 @@ ACL_VSTRING *acl_vstring_prepend(ACL_VSTRING *vp, const char *buf, size_t len)
/*
* Move the existing content and copy the new content.
*/
new_len = ACL_VSTRING_LEN(vp) + len;
ACL_VSTRING_SPACE(vp, len);
new_len = (ssize_t) (ACL_VSTRING_LEN(vp) + len);
ACL_VSTRING_SPACE(vp, (int) len);
memmove(acl_vstring_str(vp) + len, acl_vstring_str(vp), ACL_VSTRING_LEN(vp));
memcpy(acl_vstring_str(vp), buf, len);
ACL_VSTRING_AT_OFFSET(vp, new_len);
@ -562,7 +562,7 @@ ACL_VSTRING *acl_vstring_import(char *str)
vp = (ACL_VSTRING *) acl_mymalloc(sizeof(*vp));
vp->slice = NULL;
len = strlen(str);
len = (int) strlen(str);
vp->vbuf.data = (unsigned char *) str;
vp->vbuf.len = len + 1;
ACL_VSTRING_AT_OFFSET(vp, len);
@ -574,7 +574,7 @@ void acl_vstring_glue(ACL_VSTRING *vp, void *buf, size_t len)
{
vp->vbuf.flags = 0;
vp->vbuf.data = buf;
vp->vbuf.len = len;
vp->vbuf.len = (int) len;
ACL_VSTRING_RESET(vp);
vp->vbuf.data[0] = 0;
vp->vbuf.get_ready = vstring_buf_get_ready;
@ -646,14 +646,14 @@ ACL_VSTRING *acl_vstring_vsprintf_append(ACL_VSTRING *vp, const char *format, va
ACL_VSTRING *acl_vstring_sprintf_prepend(ACL_VSTRING *vp, const char *format,...)
{
va_list ap;
ssize_t old_len = ACL_VSTRING_LEN(vp);
ssize_t old_len = (ssize_t) ACL_VSTRING_LEN(vp);
ssize_t result_len;
/* Construct: old|new|free */
va_start(ap, format);
vp = acl_vstring_vsprintf_append(vp, format, ap);
va_end(ap);
result_len = ACL_VSTRING_LEN(vp);
result_len = (ssize_t) ACL_VSTRING_LEN(vp);
/* Construct: old|new|old|free */
ACL_VSTRING_SPACE(vp, old_len); /* avoid dangling pointer */

View File

@ -52,7 +52,7 @@ ACL_ARGV *acl_argv_splitn(const char *str, const char *delim, size_t n)
ACL_ARGV *acl_argv_splitn4(const char *str, const char *delim,
size_t n, ACL_SLICE_POOL *slice)
{
ACL_ARGV *argvp = acl_argv_alloc2(n > 0 ? n : 1, slice);
ACL_ARGV *argvp = acl_argv_alloc2(n > 0 ? (int) n : 1, slice);
char *saved_string = slice ?
acl_slice_pool_strdup(__FILE__, __LINE__, slice, str) :
acl_mystrdup(str);

View File

@ -485,7 +485,7 @@ unsigned acl_hash_func3(const void *buf, size_t len)
n = 0;
k = (const unsigned char *) buf;
loop = (len + 8 - 1) >> 3;
loop = ((unsigned int) len + 8 - 1) >> 3;
switch (len & (8 - 1)) {
case 0:
do {

View File

@ -165,7 +165,7 @@ static char *__sane_inet_ntoa(unsigned int src, char *dst, size_t size)
snprintf (dst, 18, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]);
#elif defined(HP_UX)
snprintf (dst, 18, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
snprintf (dst, 18, "%d.%d.%d.%d", bytes[3], bytes[2], bytes[1], bytes[0]);
#else
snprintf (dst, 18, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]);

View File

@ -77,7 +77,7 @@ void acl_token_name(const ACL_TOKEN *token, ACL_VSTRING *buf)
pend = acl_vstring_end(buf) - 1;
ptr = STR(buf);
i = 0;
n = (pend - ptr + 1) / 2;
n = (int) (pend - ptr + 1) / 2;
while (i < n) {
ch = *ptr;
*ptr = *pend;

View File

@ -13,7 +13,7 @@
#include <sys/types.h>
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
#include <io.h>
#endif
@ -235,7 +235,7 @@ ACL_CFG_PARSER *acl_cfg_parser_load(const char *pathname, const char *delimiter)
#ifdef ACL_UNIX
filefd = acl_file_open(pathname, O_RDWR, S_IREAD | S_IWRITE | S_IRGRP);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
filefd = acl_file_open(pathname, O_RDWR, S_IREAD | S_IWRITE);
#else
# error "unknown OS"
@ -496,7 +496,7 @@ static int _cfg_line_dump(ACL_FILE_HANDLE filefd, const ACL_CFG_LINE *cfg_line,
n = cfg_line->ncount;
if (delimiter != NULL)
j = strlen(delimiter);
j = (int) strlen(delimiter);
else
j = 0;
@ -504,7 +504,7 @@ static int _cfg_line_dump(ACL_FILE_HANDLE filefd, const ACL_CFG_LINE *cfg_line,
for (i = 0; i < n; i++) {
if (cfg_line->value[i] == NULL)
break;
dlen += strlen(cfg_line->value[i]) + j;
dlen += (int) strlen(cfg_line->value[i]) + j;
}
dlen += 2; /* for '\n' and '\0' */
pbuf = (char *) acl_mycalloc(1, dlen);
@ -528,7 +528,7 @@ static int _cfg_line_dump(ACL_FILE_HANDLE filefd, const ACL_CFG_LINE *cfg_line,
return (-1);
}
} else if (cfg_line->pdata != NULL) {
dlen = strlen(cfg_line->pdata) + 2;
dlen = (int) strlen(cfg_line->pdata) + 2;
pbuf = (char *) acl_mycalloc(1, dlen);
if (pbuf == NULL)
return (-1);
@ -564,7 +564,7 @@ int acl_cfg_parser_dump(const ACL_CFG_PARSER *parser,
filefd = acl_file_open(pathname,
O_CREAT | O_TRUNC | O_APPEND | O_WRONLY,
S_IREAD | S_IWRITE | S_IRGRP);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
filefd = acl_file_open(pathname,
O_CREAT | O_TRUNC | O_APPEND | O_WRONLY,
S_IREAD | S_IWRITE);

View File

@ -18,7 +18,7 @@
#define ASSERT acl_assert
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
# define SANE_STRDUP _strdup
#else
# define SANE_STRDUP strdup

View File

@ -13,7 +13,7 @@
#pragma hdrstop
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
# define SANE_STRDUP _strdup
#else
# define SANE_STRDUP strdup

View File

@ -9,7 +9,7 @@
#endif /* ACL_PREPARE_COMPILE */
#ifdef WIN32
#ifdef ACL_WINDOWS
#include <direct.h>
#include <stdlib.h>
@ -66,7 +66,7 @@ _tDIR * _topendir(const _TCHAR *dirname)
/* Allocate space for a copy of the directory name, plus
* room for the "*.*" we will concatenate to the end.
*/
len = _tcslen(dirname);
len = (int) _tcslen(dirname);
if ((name = malloc((len+5) * sizeof(_TCHAR))) == NULL) {
acl_set_error(ENOMEM);
return (NULL);
@ -260,4 +260,4 @@ int _tclosedir(_tDIR *dir)
return 0;
}
#endif /* WIN32 */
#endif /* ACL_WINDOWS */

View File

@ -327,7 +327,7 @@ void acl_fhandle_close(ACL_FHANDLE *fs, int delay_timeout)
void acl_fhandle_lock(ACL_FHANDLE *fs)
{
const char *myname = "acl_fhandle_lock";
#ifdef WIN32
#ifdef ACL_WINDOWS
unsigned long tid = acl_pthread_self();
#else
acl_pthread_t tid = acl_pthread_self();
@ -376,7 +376,7 @@ void acl_fhandle_unlock(ACL_FHANDLE *fs)
}
/* xxx: 必须清除线程锁的所有者 */
#ifdef WIN32
#ifdef ACL_WINDOWS
fs->lock_mutex_tid = (unsigned int) -1;
#else
fs->lock_mutex_tid = (acl_pthread_t) -1;
@ -413,7 +413,7 @@ void acl_fhandle_init(int cache_size, int debug_section, unsigned int flags)
__cache_max_size = cache_size > 0 ? cache_size : 100;
__debug_section = debug_section;
#ifdef WIN32
#ifdef ACL_WINDOWS
/* win32 下文件名及路径名是不区分大小写的,所以基于文件路径为键的哈希表
*
*/

View File

@ -119,7 +119,7 @@ int acl_make_dirs(const char *path, int perms)
return (ret);
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
int acl_make_dirs(const char *path, int perms)
{

View File

@ -43,7 +43,7 @@ char *acl_sane_basename(ACL_VSTRING *bp, const char *path)
last = path + strlen(path) - 1;
#ifdef ACL_UNIX
while (*last == '/') {
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
while (*last == '/' || *last == '\\') {
#endif
if (last == path)
@ -57,7 +57,7 @@ char *acl_sane_basename(ACL_VSTRING *bp, const char *path)
first = last - 1;
#ifdef ACL_UNIX
while (first >= path && *first != '/')
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
while (first >= path && *first != '/' && *first != '\\')
#endif
first--;
@ -93,7 +93,7 @@ char *acl_sane_dirname(ACL_VSTRING *bp, const char *path)
last = path + strlen(path) - 1;
#ifdef ACL_UNIX
while (*last == '/') {
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
while (*last == '/' || *last == '\\') {
#endif
if (last == path)
@ -106,7 +106,7 @@ char *acl_sane_dirname(ACL_VSTRING *bp, const char *path)
*/
#ifdef ACL_UNIX
while (last >= path && *last != '/')
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
while (last >= path && *last != '/' && *last != '\\')
#endif
last--;
@ -118,7 +118,7 @@ char *acl_sane_dirname(ACL_VSTRING *bp, const char *path)
*/
#ifdef ACL_UNIX
while (last > path && *last == '/')
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
while (last > path && (*last == '/' || *last == '\\'))
#endif
last--;

View File

@ -31,7 +31,7 @@
#include "stdlib/acl_dir.h"
#ifdef WIN32
#ifdef ACL_WINDOWS
# define SANE_RMDIR _rmdir
# define SANE_UNLINK _unlink
#else
@ -198,7 +198,7 @@ int acl_scan_dir_push(ACL_SCAN_DIR *scan, const char *path)
size_t len = strlen(path);
const char *ptr = path + len - 1;
#ifdef WIN32
#ifdef ACL_WINDOWS
while (ptr > path && (*ptr == '/' || *ptr == '\\'))
#else
while (ptr > path && *ptr == '/')

View File

@ -5,7 +5,7 @@
extern "C" {
#endif
#ifdef WIN32
#if defined(WIN32) || defined(WIN64)
#include <direct.h>
#define __S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))

View File

@ -3,7 +3,7 @@
#include "stdlib/acl_define.h"
#ifdef WIN32
#ifdef ACL_WINDOWS
#pragma once
#endif
@ -40,7 +40,7 @@ void acl_doze(unsigned delay)
acl_msg_fatal("doze: select: %s",
acl_last_strerror(tbuf, sizeof(tbuf)));
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
Sleep(delay);
#else
#error "unknown OS"

View File

@ -12,7 +12,7 @@
#include "stdlib/unix/acl_sane_socketpair.h"
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
#define HAS_DUPLEX_PIPE
#endif

View File

@ -30,7 +30,7 @@ int acl_non_blocking(ACL_SOCKET fd, int on)
#ifdef ACL_UNIX
int flags;
int nonb = PATTERN;
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
unsigned long n = on;
#endif
#ifdef NBLOCK_SYSV
@ -69,7 +69,7 @@ int acl_non_blocking(ACL_SOCKET fd, int on)
acl_msg_error("fcntl(fd, F_SETL, nonb) failed");
return -1;
}
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
if (ioctlsocket(fd, FIONBIO, &n) < 0) {
acl_msg_error("ioctlsocket(fd,FIONBIO) failed");
return -1;
@ -89,7 +89,7 @@ int acl_is_blocking(ACL_SOCKET fd)
return -1;
}
return (flags & PATTERN) == 0 ? 1 : 0;
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
const char *myname = "acl_is_blocking";
acl_msg_error("%s(%d), %s: unsport in win32",

View File

@ -38,7 +38,7 @@ int acl_peekfd(ACL_SOCKET fd)
*/
#ifdef ACL_UNIX
return (ioctl(fd, FIONREAD, (char *) &count) < 0 ? -1 : count);
#elif defined(WIN32)
#elif defined(ACL_WINDOWS)
return (ioctlsocket(fd, FIONREAD, (unsigned long *) &count) < 0 ? -1 : count);
#endif
}

View File

@ -8,7 +8,7 @@
#endif
#ifdef WIN32
#ifdef ACL_WINDOWS
#include "thread/acl_pthread.h"
#include <process.h>

View File

@ -228,7 +228,7 @@ int acl_read_wait(ACL_SOCKET fd, int timeout)
/*
* Sanity checks.
*/
#ifndef WIN32
#ifndef ACL_WINDOWS
if (FD_SETSIZE <= (unsigned) fd)
acl_msg_fatal("%s(%d), %s: descriptor %d does not fit "
"FD_SETSIZE %d", __FILE__, __LINE__, myname,
@ -256,14 +256,14 @@ int acl_read_wait(ACL_SOCKET fd, int timeout)
acl_set_error(0);
for (;;) {
#ifdef WIN32
#ifdef ACL_WINDOWS
switch (select(1, &rfds, (fd_set *) 0, &xfds, tp)) {
#else
switch (select(fd + 1, &rfds, (fd_set *) 0, &xfds, tp)) {
#endif
case -1:
errnum = acl_last_error();
#ifdef WIN32
#ifdef ACL_WINDOWS
if (errnum == WSAEINPROGRESS
|| errnum == WSAEWOULDBLOCK
|| errnum == ACL_EINTR)

View File

@ -98,10 +98,12 @@ int acl_readable(ACL_SOCKET fd)
* Loop until we have an authoritative answer.
*/
for (;;) {
switch (select(fd + 1, &rfds, (fd_set *) 0, &xfds, &tv)) {
switch (select((int) fd + 1, &rfds, (fd_set *) 0,
&xfds, &tv))
{
case -1:
errnum = acl_last_error();
#ifdef WIN32
#ifdef ACL_WINDOWS
if (errnum == WSAEINPROGRESS
|| errnum == WSAEWOULDBLOCK
|| errnum == ACL_EINTR)

View File

@ -76,7 +76,7 @@ int acl_write_wait(ACL_SOCKET fd, int timeout)
struct timeval *tp;
int errnum;
#ifndef WIN32
#ifndef ACL_WINDOWS
/*
* Sanity checks.
*/
@ -107,14 +107,14 @@ int acl_write_wait(ACL_SOCKET fd, int timeout)
acl_set_error(0);
for (;;) {
#ifdef WIN32
#ifdef ACL_WINDOWS
switch (select(1, (fd_set *) 0, &wfds, &xfds, tp)) {
#else
switch (select(fd + 1, (fd_set *) 0, &wfds, &xfds, tp)) {
#endif
case -1:
errnum = acl_last_error();
#ifdef WIN32
#ifdef ACL_WINDOWS
if (errnum == WSAEINPROGRESS
|| errnum == WSAEWOULDBLOCK
|| errnum == ACL_EINTR)

View File

@ -391,10 +391,10 @@ int acl_allocator_pool_inuse_size(ACL_ALLOCATOR *allocator, acl_mem_type type)
const char *myname = "acl_allocator_pool_inuse_size";
CHECK_TYPE(type);
return allocator->pool_inuse_size(allocator->MemPools[type]);
return (int) allocator->pool_inuse_size(allocator->MemPools[type]);
}
int acl_allocator_pool_total_allocated(ACL_ALLOCATOR *allocator)
{
return allocator->pool_total_allocated(allocator);
return (int) allocator->pool_total_allocated(allocator);
}

Some files were not shown because too many files have changed in this diff Show More