Fix compilation errors for VS 16.8.1 (#8024)

* fix compilation issues for VS 16.8.* release

* - VS 16.8 changed its template instantiation model, so now the compiler checks the syntax used in template even when it's not instantiated. we were relying on that behavior to declare the list of required localized strings from a shared header => replacing that template with a macro.

* - fix 3 C++ `const auto&` bugs the new compiler was able to uncover

* - enabled /Zc:twoPhase- for bootstrapper and PowerToysSetupCustomActions to workaround 10.0.17134.0 headers' issue.

- PowerToysSetupCustomActions.vcxproj now uses 10.0.17134.0 instead of "latest" SDK

* - PowerToysSetupCustomActions project leverages `goto` operator's power extensively, and the new compiler was able to uncover new uninitialized variables behavior, restructured declarations and changed `NULL`s to `nullptr`s.

* - Fix unit FZ unit test compiler error

* - format FZS unit test source file

* fixup fz tests

* use /Zc:twoPhase- for common-md as well
This commit is contained in:
Andrey Nekrasov
2020-11-13 15:57:01 +03:00
committed by GitHub
parent 1826b38aa9
commit c1b1fe6371
11 changed files with 143 additions and 136 deletions

View File

@@ -15,7 +15,7 @@
<ProjectGuid>{32f3882b-f2d6-4586-b5ed-11e39e522bd3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>PowerToysSetupCustomActions</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -97,6 +97,8 @@
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/await /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/await /Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>