Skip to content

Commit dbdbdf7

Browse files
committed
Made the compiler less cranky.
1 parent 8eaa72a commit dbdbdf7

File tree

8 files changed

+39
-15
lines changed

8 files changed

+39
-15
lines changed

src/AppInstallerCLI/AppInstallerCLI.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<PlatformToolset>v140</PlatformToolset>
5555
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
5656
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
57+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
5758
<CharacterSet>Unicode</CharacterSet>
5859
</PropertyGroup>
5960
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">

src/AppInstallerCLICore/Workflows/ImportExportFlow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ namespace AppInstaller::CLI::Workflow
163163

164164
void ReadImportFile(Execution::Context& context)
165165
{
166-
std::ifstream importFile{ context.Args.GetArg(Execution::Args::Type::ImportFile) };
166+
std::ifstream importFile(std::string(context.Args.GetArg(Execution::Args::Type::ImportFile)));
167167
THROW_LAST_ERROR_IF(importFile.fail());
168168

169169
Json::Value jsonRoot;

src/AppInstallerCLITests/NameNormalization.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ using namespace AppInstaller::Utility;
1313
// copy the file(s) back to the git managed location to update.
1414
TEST_CASE("NameNorm_Update_Database_Initial", "[.]")
1515
{
16-
std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt"));
16+
std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt").GetPath());
1717
REQUIRE(namesStream);
18-
std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt"));
18+
std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt").GetPath());
1919
REQUIRE(publishersStream);
20-
std::ofstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIdsUpdate.txt"), std::ofstream::out | std::ofstream::trunc | std::ofstream::binary);
20+
std::ofstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIdsUpdate.txt").GetPath(), std::ofstream::out | std::ofstream::trunc | std::ofstream::binary);
2121
REQUIRE(resultsStream);
2222

2323
// Far larger than any one value; hopefully
@@ -60,11 +60,11 @@ TEST_CASE("NameNorm_Update_Database_Initial", "[.]")
6060
// source.
6161
TEST_CASE("NameNorm_Database_Initial", "[name_norm]")
6262
{
63-
std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt"));
63+
std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt").GetPath());
6464
REQUIRE(namesStream);
65-
std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt"));
65+
std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt").GetPath());
6666
REQUIRE(publishersStream);
67-
std::ifstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIds.txt"));
67+
std::ifstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIds.txt").GetPath());
6868
REQUIRE(resultsStream);
6969

7070
// Far larger than any one value; hopefully

src/AppInstallerCLITests/YamlManifest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ TEST_CASE("ReadPreviewGoodManifestAndVerifyContents", "[ManifestValidation]")
122122
REQUIRE(localization1.Get<Localization::LicenseUrl>() == "https://github.com/microsoft/msix-packaging/blob/master/LICENSE-es-MX");
123123

124124
// Stream hash
125-
std::ifstream stream(manifestFile, std::ios_base::in | std::ios_base::binary);
125+
std::ifstream stream(manifestFile.GetPath(), std::ios_base::in | std::ios_base::binary);
126126
REQUIRE(!stream.fail());
127127
auto manifestHash = SHA256::ComputeHash(stream);
128128
REQUIRE(manifestHash.size() == manifest.StreamSha256.size());

src/AppInstallerCommonCore/Downloader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
3+
34
#include "pch.h"
45
#include "Public/AppInstallerErrors.h"
56
#include "Public/AppInstallerRuntime.h"
@@ -22,6 +23,9 @@ namespace AppInstaller::Utility
2223
IProgressCallback& progress,
2324
bool computeHash)
2425
{
26+
// For AICLI_LOG usages with string literals.
27+
#pragma warning(disable:26449)
28+
2529
AICLI_LOG(Core, Info, << "WinINet downloading from url: " << url);
2630

2731
wil::unique_hinternet session(InternetOpenA(
@@ -126,6 +130,8 @@ namespace AppInstaller::Utility
126130

127131
AICLI_LOG(Core, Info, << "Download completed.");
128132

133+
#pragma warning(disable:26449)
134+
129135
return result;
130136
}
131137

src/JsonCppLib/JsonCppLib.vcxproj

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,38 +49,45 @@
4949
<ConfigurationType>StaticLibrary</ConfigurationType>
5050
<UseDebugLibraries>true</UseDebugLibraries>
5151
<PlatformToolset>v142</PlatformToolset>
52+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
5253
</PropertyGroup>
5354
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
5455
<ConfigurationType>StaticLibrary</ConfigurationType>
5556
<UseDebugLibraries>false</UseDebugLibraries>
5657
<PlatformToolset>v142</PlatformToolset>
58+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
5759
<SpectreMitigation>Spectre</SpectreMitigation>
5860
</PropertyGroup>
5961
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
6062
<ConfigurationType>StaticLibrary</ConfigurationType>
6163
<UseDebugLibraries>true</UseDebugLibraries>
6264
<PlatformToolset>v142</PlatformToolset>
65+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
6366
</PropertyGroup>
6467
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
6568
<ConfigurationType>StaticLibrary</ConfigurationType>
6669
<UseDebugLibraries>true</UseDebugLibraries>
6770
<PlatformToolset>v142</PlatformToolset>
71+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
6872
</PropertyGroup>
6973
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
7074
<ConfigurationType>StaticLibrary</ConfigurationType>
7175
<UseDebugLibraries>true</UseDebugLibraries>
7276
<PlatformToolset>v142</PlatformToolset>
77+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
7378
</PropertyGroup>
7479
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
7580
<ConfigurationType>StaticLibrary</ConfigurationType>
7681
<UseDebugLibraries>false</UseDebugLibraries>
7782
<PlatformToolset>v142</PlatformToolset>
78-
<SpectreMitigation>Spectre</SpectreMitigation>
83+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
84+
<SpectreMitigation>Spectre</SpectreMitigation>
7985
</PropertyGroup>
8086
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fuzzing|x64'" Label="Configuration">
8187
<ConfigurationType>StaticLibrary</ConfigurationType>
8288
<UseDebugLibraries>false</UseDebugLibraries>
83-
<PlatformToolset>v142</PlatformToolset>
89+
<PlatformToolset>v142</PlatformToolset>
90+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
8491
<EnableASAN>true</EnableASAN>
8592
</PropertyGroup>
8693
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
@@ -93,7 +100,8 @@
93100
<ConfigurationType>StaticLibrary</ConfigurationType>
94101
<UseDebugLibraries>false</UseDebugLibraries>
95102
<PlatformToolset>v142</PlatformToolset>
96-
<SpectreMitigation>Spectre</SpectreMitigation>
103+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
104+
<SpectreMitigation>Spectre</SpectreMitigation>
97105
</PropertyGroup>
98106
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
99107
<ImportGroup Label="ExtensionSettings">

src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<ConfigurationType>Application</ConfigurationType>
3131
<UseDebugLibraries>false</UseDebugLibraries>
3232
<PlatformToolset>v142</PlatformToolset>
33+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
3334
<WholeProgramOptimization>false</WholeProgramOptimization>
3435
<CharacterSet>Unicode</CharacterSet>
3536
</PropertyGroup>

src/cpprestsdk/cpprestsdk.vcxproj

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,51 +47,59 @@
4747
<ConfigurationType>StaticLibrary</ConfigurationType>
4848
<UseDebugLibraries>true</UseDebugLibraries>
4949
<PlatformToolset>v142</PlatformToolset>
50+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
5051
<CharacterSet>Unicode</CharacterSet>
5152
</PropertyGroup>
5253
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
5354
<ConfigurationType>StaticLibrary</ConfigurationType>
5455
<UseDebugLibraries>false</UseDebugLibraries>
5556
<PlatformToolset>v142</PlatformToolset>
56-
<CharacterSet>Unicode</CharacterSet>
57+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
58+
<CharacterSet>Unicode</CharacterSet>
5759
<SpectreMitigation>Spectre</SpectreMitigation>
5860
</PropertyGroup>
5961
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
6062
<ConfigurationType>StaticLibrary</ConfigurationType>
6163
<UseDebugLibraries>true</UseDebugLibraries>
6264
<PlatformToolset>v142</PlatformToolset>
63-
<CharacterSet>Unicode</CharacterSet>
65+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
66+
<CharacterSet>Unicode</CharacterSet>
6467
</PropertyGroup>
6568
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
6669
<ConfigurationType>StaticLibrary</ConfigurationType>
6770
<UseDebugLibraries>false</UseDebugLibraries>
6871
<PlatformToolset>v142</PlatformToolset>
72+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
6973
<CharacterSet>Unicode</CharacterSet>
7074
<SpectreMitigation>Spectre</SpectreMitigation>
7175
</PropertyGroup>
7276
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
7377
<ConfigurationType>StaticLibrary</ConfigurationType>
7478
<UseDebugLibraries>true</UseDebugLibraries>
7579
<PlatformToolset>v142</PlatformToolset>
76-
<CharacterSet>Unicode</CharacterSet>
80+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
81+
<CharacterSet>Unicode</CharacterSet>
7782
</PropertyGroup>
7883
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
7984
<ConfigurationType>StaticLibrary</ConfigurationType>
8085
<UseDebugLibraries>true</UseDebugLibraries>
8186
<PlatformToolset>v142</PlatformToolset>
87+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
8288
<CharacterSet>Unicode</CharacterSet>
8389
</PropertyGroup>
8490
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
8591
<ConfigurationType>StaticLibrary</ConfigurationType>
8692
<UseDebugLibraries>false</UseDebugLibraries>
8793
<PlatformToolset>v142</PlatformToolset>
88-
<CharacterSet>Unicode</CharacterSet>
94+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
95+
<CharacterSet>Unicode</CharacterSet>
8996
<SpectreMitigation>Spectre</SpectreMitigation>
9097
</PropertyGroup>
9198
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
9299
<ConfigurationType>StaticLibrary</ConfigurationType>
93100
<UseDebugLibraries>false</UseDebugLibraries>
94101
<PlatformToolset>v142</PlatformToolset>
102+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
95103
<CharacterSet>Unicode</CharacterSet>
96104
<SpectreMitigation>Spectre</SpectreMitigation>
97105
</PropertyGroup>

0 commit comments

Comments
 (0)