1
0
mirror of synced 2026-04-30 05:25:23 +00:00

Updated project to build on latest Visual Studio (2019).

This involves:
- updated project files,
- removal of support for XP
- update to latest boost (1.75)
- updating code to work around new deprecation warnings

There is also some cleanup in the project files here.
This commit is contained in:
Andras Tantos
2021-02-02 17:24:20 -08:00
parent 3e08db5099
commit ec676c06cf
28 changed files with 156 additions and 175 deletions

View File

@@ -29,28 +29,27 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{8A280901-357C-4A38-881E-841654C8A6BD}</ProjectGuid>
<RootNamespace>sim_lib</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_PGO_Inst|Win32'" Label="Configuration">
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_PGO_Inst|x64'" Label="Configuration">
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

View File

@@ -126,9 +126,6 @@
<ClCompile Include="cray_softcpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cray_dpicpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cray_cpu.h">
@@ -266,8 +263,5 @@
<ClInclude Include="cray_softcpu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cray_dpicpu.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -4,6 +4,7 @@
#endif //NOMINMAX
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <memory>
#include "vtap_win32.h"
@@ -217,6 +218,13 @@ void TapAdapter_c::Close() {
mReadPending = false;
}
static uint32_t InetAddr(const char* aAddr) {
uint32_t BinAddr;
INT RetVal = inet_pton(AF_INET, aAddr, &BinAddr);
if (RetVal != 1) throw Generic_x() << "Failed to resolve address: " << aAddr << " with error code: " << HexPrinter(RetVal);
return BinAddr;
}
void TapAdapter_c::Open(const char *aIpAddr, const char *aNetMask, const char *aDhcpServerIpAddr, size_t aLeaseTime) {
std::stringstream DeviceName;
DeviceName << "\\\\.\\Global\\" << mDeviceGuid << ".tap";
@@ -246,9 +254,9 @@ void TapAdapter_c::Open(const char *aIpAddr, const char *aNetMask, const char *a
// }
if (aIpAddr != nullptr) {
IoctlData[0] = inet_addr(aIpAddr);
IoctlData[1] = aNetMask == nullptr ? 0 : ~inet_addr(aNetMask);
IoctlData[2] = aDhcpServerIpAddr == nullptr ? 0 : inet_addr(aDhcpServerIpAddr);
IoctlData[0] = InetAddr(aIpAddr);
IoctlData[1] = aNetMask == nullptr ? 0 : ~InetAddr(aNetMask);
IoctlData[2] = aDhcpServerIpAddr == nullptr ? 0 : InetAddr(aDhcpServerIpAddr);
IoctlData[3] = ULONG(aLeaseTime);
if (!DeviceIoControl(mDeviceHandle, TAP_IOCTL_CONFIG_DHCP_MASQ, IoctlData, sizeof(IoctlData[0]) * 4, IoctlData, sizeof(IoctlData), &Length, nullptr)) {