Allow YSFClients to compile under Windows.
This commit is contained in:
parent
dfe50c4245
commit
aecc34ee64
10 changed files with 158 additions and 5 deletions
|
@ -94,6 +94,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -111,6 +114,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
|
@ -124,6 +130,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
|
@ -141,6 +150,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="APRSWriter.cpp" />
|
||||
|
|
|
@ -69,10 +69,11 @@ private:
|
|||
unsigned short m_localPort;
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
SOCKET m_fd;
|
||||
int m_af;
|
||||
#else
|
||||
int m_fd;
|
||||
#endif
|
||||
sa_family_t m_af;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
38
DGIdGateway/prebuild.cmd
Normal file
38
DGIdGateway/prebuild.cmd
Normal file
|
@ -0,0 +1,38 @@
|
|||
@echo off
|
||||
REM This pre-build file is for MSVS VC++. It parses the git master hash and
|
||||
REM converts it into GitVersion.h for compiling into builds. [George M1GEO]
|
||||
|
||||
cd %1
|
||||
setlocal enabledelayedexpansion
|
||||
set HEADFILE=..\.git\HEAD
|
||||
set HASHFILE=0
|
||||
if exist %HEADFILE% (
|
||||
for /F "tokens=4 delims=/:" %%a in ('type %HEADFILE%') do set HEADBRANCH=%%a
|
||||
set HASHFILE=.git\refs\heads\!HEADBRANCH!
|
||||
echo Found Git HEAD file: %HEADFILE%
|
||||
echo Git HEAD branch: !HEADBRANCH!
|
||||
echo Git HASH file: !HASHFILE!
|
||||
call :USEHASH
|
||||
) else (
|
||||
echo No head file :(
|
||||
call :USENULL
|
||||
)
|
||||
|
||||
goto :EOF
|
||||
|
||||
:USENULL
|
||||
set GITHASH=0000000000000000000000000000000000000000
|
||||
goto :WRITEGITVERSIONHEADER
|
||||
|
||||
:USEHASH
|
||||
for /f %%i in ('type !HASHFILE!') do set GITHASH=%%i
|
||||
goto :WRITEGITVERSIONHEADER
|
||||
|
||||
:WRITEGITVERSIONHEADER
|
||||
echo // File contains Git commit ID SHA1 present at buildtime (prebuild.cmd) > GitVersion.h
|
||||
echo const char *gitversion = "%GITHASH%"; >> GitVersion.h
|
||||
echo Current Git HASH: %GITHASH%
|
||||
goto :FINISHED
|
||||
|
||||
:FINISHED
|
||||
echo GitVersion.h written...
|
|
@ -69,10 +69,11 @@ private:
|
|||
unsigned short m_localPort;
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
SOCKET m_fd;
|
||||
int m_af;
|
||||
#else
|
||||
int m_fd;
|
||||
#endif
|
||||
sa_family_t m_af;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -886,7 +886,7 @@ void CYSFGateway::processRemoteCommands()
|
|||
if ((::memcmp(buffer + 0U, "LinkYSF", 7U) == 0) && (strlen((char*)buffer + 0U) > 8)) {
|
||||
std::string id = std::string((char*)(buffer + 8U));
|
||||
// Left trim
|
||||
id.erase(id.begin(), std::find_if(id.begin(), id.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
|
||||
id.erase(id.begin(), std::find_if(id.begin(), id.end(), [](unsigned char ch) { return !std::isspace(ch); }));
|
||||
CYSFReflector* reflector = m_reflectors->findById(id);
|
||||
if (reflector == NULL)
|
||||
reflector = m_reflectors->findByName(id);
|
||||
|
@ -917,7 +917,7 @@ void CYSFGateway::processRemoteCommands()
|
|||
} else if ((::memcmp(buffer + 0U, "LinkFCS", 7U) == 0) && (strlen((char*)buffer + 0U) > 8)) {
|
||||
std::string raw = std::string((char*)(buffer + 8U));
|
||||
// Left trim
|
||||
raw.erase(raw.begin(), std::find_if(raw.begin(), raw.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
|
||||
raw.erase(raw.begin(), std::find_if(raw.begin(), raw.end(), [](unsigned char ch) { return !std::isspace(ch); }));
|
||||
std::string id = "FCS00";
|
||||
std::string idShort = "FCS";
|
||||
if (raw.length() == 3U) {
|
||||
|
|
|
@ -94,6 +94,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
|
@ -108,6 +111,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -126,6 +132,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
|
@ -144,6 +153,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="APRSWriter.h" />
|
||||
|
|
38
YSFGateway/prebuild.cmd
Normal file
38
YSFGateway/prebuild.cmd
Normal file
|
@ -0,0 +1,38 @@
|
|||
@echo off
|
||||
REM This pre-build file is for MSVS VC++. It parses the git master hash and
|
||||
REM converts it into GitVersion.h for compiling into builds. [George M1GEO]
|
||||
|
||||
cd %1
|
||||
setlocal enabledelayedexpansion
|
||||
set HEADFILE=..\.git\HEAD
|
||||
set HASHFILE=0
|
||||
if exist %HEADFILE% (
|
||||
for /F "tokens=4 delims=/:" %%a in ('type %HEADFILE%') do set HEADBRANCH=%%a
|
||||
set HASHFILE=.git\refs\heads\!HEADBRANCH!
|
||||
echo Found Git HEAD file: %HEADFILE%
|
||||
echo Git HEAD branch: !HEADBRANCH!
|
||||
echo Git HASH file: !HASHFILE!
|
||||
call :USEHASH
|
||||
) else (
|
||||
echo No head file :(
|
||||
call :USENULL
|
||||
)
|
||||
|
||||
goto :EOF
|
||||
|
||||
:USENULL
|
||||
set GITHASH=0000000000000000000000000000000000000000
|
||||
goto :WRITEGITVERSIONHEADER
|
||||
|
||||
:USEHASH
|
||||
for /f %%i in ('type !HASHFILE!') do set GITHASH=%%i
|
||||
goto :WRITEGITVERSIONHEADER
|
||||
|
||||
:WRITEGITVERSIONHEADER
|
||||
echo // File contains Git commit ID SHA1 present at buildtime (prebuild.cmd) > GitVersion.h
|
||||
echo const char *gitversion = "%GITHASH%"; >> GitVersion.h
|
||||
echo Current Git HASH: %GITHASH%
|
||||
goto :FINISHED
|
||||
|
||||
:FINISHED
|
||||
echo GitVersion.h written...
|
|
@ -69,10 +69,11 @@ private:
|
|||
unsigned short m_localPort;
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
SOCKET m_fd;
|
||||
int m_af;
|
||||
#else
|
||||
int m_fd;
|
||||
#endif
|
||||
sa_family_t m_af;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -94,6 +94,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
|
@ -108,6 +111,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -126,6 +132,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
|
@ -144,6 +153,9 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>prebuild.cmd</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StopWatch.h" />
|
||||
|
|
38
YSFParrot/prebuild.cmd
Normal file
38
YSFParrot/prebuild.cmd
Normal file
|
@ -0,0 +1,38 @@
|
|||
@echo off
|
||||
REM This pre-build file is for MSVS VC++. It parses the git master hash and
|
||||
REM converts it into GitVersion.h for compiling into builds. [George M1GEO]
|
||||
|
||||
cd %1
|
||||
setlocal enabledelayedexpansion
|
||||
set HEADFILE=..\.git\HEAD
|
||||
set HASHFILE=0
|
||||
if exist %HEADFILE% (
|
||||
for /F "tokens=4 delims=/:" %%a in ('type %HEADFILE%') do set HEADBRANCH=%%a
|
||||
set HASHFILE=.git\refs\heads\!HEADBRANCH!
|
||||
echo Found Git HEAD file: %HEADFILE%
|
||||
echo Git HEAD branch: !HEADBRANCH!
|
||||
echo Git HASH file: !HASHFILE!
|
||||
call :USEHASH
|
||||
) else (
|
||||
echo No head file :(
|
||||
call :USENULL
|
||||
)
|
||||
|
||||
goto :EOF
|
||||
|
||||
:USENULL
|
||||
set GITHASH=0000000000000000000000000000000000000000
|
||||
goto :WRITEGITVERSIONHEADER
|
||||
|
||||
:USEHASH
|
||||
for /f %%i in ('type !HASHFILE!') do set GITHASH=%%i
|
||||
goto :WRITEGITVERSIONHEADER
|
||||
|
||||
:WRITEGITVERSIONHEADER
|
||||
echo // File contains Git commit ID SHA1 present at buildtime (prebuild.cmd) > GitVersion.h
|
||||
echo const char *gitversion = "%GITHASH%"; >> GitVersion.h
|
||||
echo Current Git HASH: %GITHASH%
|
||||
goto :FINISHED
|
||||
|
||||
:FINISHED
|
||||
echo GitVersion.h written...
|
Loading…
Reference in a new issue