Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Solutions/conformance.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
MSVC conformance mode (/permissive-) for the native SDK library projects
that import this file (win32-lib, win32-dll, win32-mini-lib, win32-mini-dll,
net40), so non-standard constructs are caught at build time. See issue #255.

This is imported explicitly per-project rather than from the shared
Solutions/build.props, because build.props is also pulled in by vendored
sqlite/zlib, the test projects (gtest/gmock/UnitTests/FuncTests), and the
samples - none of which we want to force into conformance mode. UWP /
Windows Store SDK projects (win10-*) intentionally do not import this file
because /permissive- is incompatible with C++/CX (/ZW); their shared SDK
sources are still conformance-checked through the win32 library builds.

Imported late (after the project's own ItemDefinitionGroups) so this
ConformanceMode setting wins.
-->
<ItemDefinitionGroup>
<ClCompile>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
</Project>
1 change: 1 addition & 0 deletions Solutions/net40/net40.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(SolutionDir)\build.props" Condition="Exists('$(SolutionDir)\build.props')" />
<Import Project="$(SolutionDir)\conformance.props" Condition="Exists('$(SolutionDir)\conformance.props')" />
<Import Project="$(SolutionDir)\build.net40.props" Condition="Exists('$(SolutionDir)\build.net40.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
1 change: 1 addition & 0 deletions Solutions/win32-dll/win32-dll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(SolutionDir)\build.props" Condition="Exists('$(SolutionDir)\build.props')" />
<Import Project="$(SolutionDir)\conformance.props" Condition="Exists('$(SolutionDir)\conformance.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
1 change: 1 addition & 0 deletions Solutions/win32-lib/win32-lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@
</Lib>
</ItemDefinitionGroup>
<Import Project="$(SolutionDir)\build.props" Condition="Exists('$(SolutionDir)\build.props')" />
<Import Project="$(SolutionDir)\conformance.props" Condition="Exists('$(SolutionDir)\conformance.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
1 change: 1 addition & 0 deletions Solutions/win32-mini-dll/win32-mini-dll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
</Lib>
</ItemDefinitionGroup>
<Import Project="$(SolutionDir)\build.props" Condition="Exists('$(SolutionDir)\build.props')" />
<Import Project="$(SolutionDir)\conformance.props" Condition="Exists('$(SolutionDir)\conformance.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
1 change: 1 addition & 0 deletions Solutions/win32-mini-lib/win32-mini-lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@
</Lib>
</ItemDefinitionGroup>
<Import Project="$(SolutionDir)\build.props" Condition="Exists('$(SolutionDir)\build.props')" />
<Import Project="$(SolutionDir)\conformance.props" Condition="Exists('$(SolutionDir)\conformance.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/EventPropertiesCX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Microsoft {
FromPlatformMap(propertiesMap, properties);
FromPlatformMap(this->PIITags, piiTags);

for (map<string, T>::iterator it = properties.begin(); it != properties.end(); ++it)
for (typename map<string, T>::iterator it = properties.begin(); it != properties.end(); ++it)
{
MAT::PiiKind piiType = MAT::PiiKind_None;
auto tag = piiTags.find(it->first);
Expand Down
5 changes: 5 additions & 0 deletions lib/shared/PlatformHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ namespace Microsoft {
void ThrowPlatformInvalidArgumentException(String^ message);
void ThrowPlatformException(String^ message);

// Forward declaration so the FromPlatformMap templates below can
// resolve this helper under /permissive- two-phase name lookup
// (the definition appears later in this header).
std::string FromPlatformString(String^ platformString);

// Defining the template function in the header file eliminates the need in additional linker definitions.
// platformmaptype can be read-only or editable platform map.
template <typename K1, typename V1, typename K2, typename V2, template<typename, typename> class platformmaptype>
Expand Down
Loading