summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Peyruqueou2023-03-27 11:12:55 +0200
committerVincent Peyruqueou2023-03-27 11:12:55 +0200
commit7c608bc1d5c126df839c699c5ae531828a00caa3 (patch)
tree4ebfa62a389439d9dc6fac23929714f95e23d3cb
parentc238c8851fe2f58008a8a290eb66c3531b4fd0b7 (diff)
downloadivy-c-7c608bc1d5c126df839c699c5ae531828a00caa3.zip
ivy-c-7c608bc1d5c126df839c699c5ae531828a00caa3.tar.gz
ivy-c-7c608bc1d5c126df839c699c5ae531828a00caa3.tar.bz2
ivy-c-7c608bc1d5c126df839c699c5ae531828a00caa3.tar.xz
Microsoft Visual Studio (2022) solution for src (lib IVY)
-rw-r--r--.gitignore4
-rw-r--r--ivy_c.sln41
-rw-r--r--src/intervalRegexp.c9
-rw-r--r--src/ivy.c5
-rw-r--r--src/ivy_c.sln45
-rw-r--r--src/ivy_c.vcxproj179
-rw-r--r--src/ivy_c.vcxproj.filters97
-rw-r--r--src/ivybuffer.c4
-rw-r--r--src/timer.h15
9 files changed, 344 insertions, 55 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..668ca85
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/Win32/
+src/Win32/
+src/ivy_c.vcxproj.user
+.vs/
diff --git a/ivy_c.sln b/ivy_c.sln
new file mode 100644
index 0000000..456f801
--- /dev/null
+++ b/ivy_c.sln
@@ -0,0 +1,41 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.33414.496
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ivy", "src\ivy_c.vcxproj", "{4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "pcre\build-VS2022\libpcre\libpcre.vcxproj", "{DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|x64.ActiveCfg = Debug|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|x64.Build.0 = Debug|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|x86.ActiveCfg = Debug|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|x86.Build.0 = Debug|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|x64.ActiveCfg = Release|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|x64.Build.0 = Release|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|x86.ActiveCfg = Release|Win32
+ {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|x86.Build.0 = Release|Win32
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Debug|x64.ActiveCfg = Debug|x64
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Debug|x64.Build.0 = Debug|x64
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Debug|x86.ActiveCfg = Debug|Win32
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Debug|x86.Build.0 = Debug|Win32
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Release|x64.ActiveCfg = Release|x64
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Release|x64.Build.0 = Release|x64
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Release|x86.ActiveCfg = Release|Win32
+ {DA8CB038-FD70-44B5-8ADA-5E32CA9ECACE}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {DAEA9BAD-A8F9-46DC-987B-71CC2F0FDA07}
+ EndGlobalSection
+EndGlobal
diff --git a/src/intervalRegexp.c b/src/intervalRegexp.c
index fb5e0f6..f30b9d5 100644
--- a/src/intervalRegexp.c
+++ b/src/intervalRegexp.c
@@ -3,7 +3,12 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+
+#ifdef WIN32
+#include <windows.h>
+#else
#include <unistd.h>
+#endif
#include "intervalRegexp.h"
@@ -24,9 +29,7 @@
return Perr ("CHECK_AND_RETURN"); }
#define EndLocBuf (&(locBuf[strlen(locBuf)]))
-#ifdef WIN32
-#define snprintf _snprintf
-#endif
+
#define AddLocBuf(...) snprintf (EndLocBuf, sizeof (locBuf)-strlen(locBuf), __VA_ARGS__)
typedef struct {
diff --git a/src/ivy.c b/src/ivy.c
index 7fbc553..6dd39df 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -28,13 +28,12 @@
#include <Ws2tcpip.h>
#include <windows.h>
#include "timer.h"
-#define snprintf _snprintf
+
#ifdef __MINGW32__
// should be removed in when defined in MinGW include of ws2tcpip.h
extern const char * WSAAPI inet_ntop(int af, const void *src,
char *dst, socklen_t size);
extern int WSAAPI inet_pton(int af, const char *src, void *dst);
-
#endif
#else
#include <sys/time.h>
@@ -629,7 +628,7 @@ static void Receive( Client client, const void *data, char *line )
if ( other )
{
RWIvyClientPtr target;
- // Dilemma choose the rigth client to close
+ // Dilemma choose the right client to close
// the symetric processing will try to close each other
// only one side may be closed
unsigned short int other_localPort, other_remotePort, clnt_localPort, clnt_remotePort;
diff --git a/src/ivy_c.sln b/src/ivy_c.sln
deleted file mode 100644
index 4a1d999..0000000
--- a/src/ivy_c.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ivy", "ivy_c.vcxproj", "{4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre", "..\..\pcre\pcre.vcxproj", "{D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}"
-EndProject
-Global
- GlobalSection(SourceCodeControl) = preSolution
- SccNumberOfProjects = 3
- SccLocalPath0 = .
- CanCheckoutShared = false
- SccProjectUniqueName1 = ivy_c.vcxproj
- SccLocalPath1 = .
- CanCheckoutShared = false
- SccProjectUniqueName2 = ..\\..\\pcre\\pcre.vcxproj
- SccProjectName2 = \u0022$/pcre\u0022,\u0020KSHAAAAA
- SccLocalPath2 = ..\\..\\pcre
- CanCheckoutShared = false
- EndGlobalSection
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|Win32.ActiveCfg = Debug|Win32
- {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|Win32.Build.0 = Debug|Win32
- {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Debug|x64.ActiveCfg = Debug|Win32
- {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|Win32.ActiveCfg = Release|Win32
- {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|Win32.Build.0 = Release|Win32
- {4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}.Release|x64.ActiveCfg = Release|Win32
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Debug|Win32.ActiveCfg = Debug|Win32
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Debug|Win32.Build.0 = Debug|Win32
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Debug|x64.ActiveCfg = Debug|x64
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Debug|x64.Build.0 = Debug|x64
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Release|Win32.ActiveCfg = Release|Win32
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Release|Win32.Build.0 = Release|Win32
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Release|x64.ActiveCfg = Release|x64
- {D79FC143-498E-4342-B2C7-BDAD1B8D0E6B}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/ivy_c.vcxproj b/src/ivy_c.vcxproj
new file mode 100644
index 0000000..5d45459
--- /dev/null
+++ b/src/ivy_c.vcxproj
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>17.0</VCProjectVersion>
+ <ProjectName>ivy</ProjectName>
+ <ProjectGuid>{4BD59668-D7DA-4AFC-9F27-E3CEE16940D3}</ProjectGuid>
+ <RootNamespace>ivy_c</RootNamespace>
+ <SccProjectName>
+ </SccProjectName>
+ <SccAuxPath>
+ </SccAuxPath>
+ <SccLocalPath>
+ </SccLocalPath>
+ <SccProvider>
+ </SccProvider>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v143</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v143</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ </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)'=='Debug|Win32'" 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>17.0.33312.129</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\pcre\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;DEBUG;WIN32;_LIB;REGEX_MALLOC;USE_PCRE_REGEX;PCRE_OPT=PCRE_CASELESS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>.\Debug/ivy_c.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>Ws2_32.lib;libpcre.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>libIvy.def</ModuleDefinitionFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)</AdditionalLibraryDirectories>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\pcre\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;REGEX_MALLOC;USE_PCRE_REGEX;PCRE_OPT=PCRE_CASELESS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <OpenMPSupport>false</OpenMPSupport>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <ModuleDefinitionFile>libIvy.def</ModuleDefinitionFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Message>Copy Ivy DLL to Directory</Message>
+ <Command>rem copy $(TargetPath) ../../rejeu/$(OutDir)
+rem copy $(TargetPath) ../../interpolate/$(OutDir)
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\tools\getopt.c" />
+ <ClCompile Include="intervalRegexp.c" />
+ <ClCompile Include="ivy.c">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="ivybind.c" />
+ <ClCompile Include="ivybuffer.c" />
+ <ClCompile Include="ivyfifo.c" />
+ <ClCompile Include="ivyloop.c">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="ivysocket.c">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ <ClCompile Include="param.c" />
+ <ClCompile Include="timer.c">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="libIvy.def" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\tools\getopt.h" />
+ <ClInclude Include="intervalRegexp.h" />
+ <ClInclude Include="ivy.h" />
+ <ClInclude Include="ivybind.h" />
+ <ClInclude Include="ivybuffer.h" />
+ <ClInclude Include="ivychannel.h" />
+ <ClInclude Include="ivydebug.h" />
+ <ClInclude Include="ivyfifo.h" />
+ <ClInclude Include="ivyloop.h" />
+ <ClInclude Include="ivysocket.h" />
+ <ClInclude Include="list.h" />
+ <ClInclude Include="param.h" />
+ <ClInclude Include="timer.h" />
+ <ClInclude Include="uthash.h" />
+ <ClInclude Include="version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\pcre\build-VS2022\libpcre\libpcre.vcxproj">
+ <Project>{da8cb038-fd70-44b5-8ada-5e32ca9ecace}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/ivy_c.vcxproj.filters b/src/ivy_c.vcxproj.filters
new file mode 100644
index 0000000..251866b
--- /dev/null
+++ b/src/ivy_c.vcxproj.filters
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{480c9b10-aa1e-4153-bba8-198ed53702f8}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{12aa679e-c45e-416e-b1c7-e6f7106c7158}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="intervalRegexp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ivy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ivybind.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ivybuffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ivyfifo.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ivyloop.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ivysocket.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="param.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="timer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\tools\getopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="libIvy.def">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="intervalRegexp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivy.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivybind.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivybuffer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivychannel.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivydebug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivyfifo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivyloop.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ivysocket.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="list.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="param.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="timer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="uthash.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\tools\getopt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/ivybuffer.c b/src/ivybuffer.c
index d21114f..c8d3710 100644
--- a/src/ivybuffer.c
+++ b/src/ivybuffer.c
@@ -23,10 +23,6 @@
#include <stdarg.h>
#include <string.h>
-#ifdef WIN32
-#define snprintf _snprintf
-#endif
-
#include "param.h"
#include "ivybuffer.h"
diff --git a/src/timer.h b/src/timer.h
index accad5b..627bdb2 100644
--- a/src/timer.h
+++ b/src/timer.h
@@ -44,6 +44,21 @@ struct timezone
int tz_dsttime; /* type of dst correction */
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
+
+/**
+ * timersub(3) from <sys/time.h>
+ */
+static inline void timersub(struct timeval* a, struct timeval* b,
+ struct timeval* res)
+{
+ res->tv_sec = a->tv_sec - b->tv_sec;
+ res->tv_usec = a->tv_usec - b->tv_usec;
+ if (res->tv_usec < 0)
+ {
+ res->tv_usec += 1000000;
+ res->tv_sec--;
+ }
+}
#endif
/* Interface avec select */