Skip to content

Commit 76eb09c

Browse files
authored
Clean up more warnings and Component Governance (#1475)
* Fix a couple more build warnings * Upgrade System.Text.Json to 6.0.10 * Better fix for unused size_result * Disable warning 4324 for all of wrl.h
1 parent 4bc0f82 commit 76eb09c

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

cppwinrt/component_writers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noex
198198
}
199199
200200
#ifdef _WRL_MODULE_H_
201+
#pragma warning(suppress: 4324) // structure was padded due to alignment specifier
201202
return ::Microsoft::WRL::Module<::Microsoft::WRL::InProc>::GetModule().GetActivationFactory(static_cast<HSTRING>(classId), reinterpret_cast<::IActivationFactory**>(factory));
202203
#else
203204
return winrt::hresult_class_not_available(name).to_abi();

natvis/object_visualizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ std::wstring string_to_wstring(std::string_view const& str)
612612
}
613613

614614
std::wstring result(size, L'?');
615-
auto size_result = MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast<int>(str.size()), result.data(), size);
615+
[[maybe_unused]] auto size_result = MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast<int>(str.size()), result.data(), size);
616616
XLANG_ASSERT(size == size_result);
617617
return result;
618618
}

test/old_tests/Component/pch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
#include "winrt/Composable.h"
99

1010
// This is used to validate WRL interop support.
11+
#pragma warning(push)
12+
#pragma warning(disable: 4324) // structure was padded due to alignment specifier
1113
#include <wrl.h>
14+
#pragma warning(pop)

vsix/Dev16/vsix.Dev16.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<PrivateAssets>all</PrivateAssets>
9494
</PackageReference>
9595
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
96+
<PackageReference Include="System.Text.Json" Version="6.0.10" />
9697
</ItemGroup>
9798
<ItemGroup>
9899
<EmbeddedResource Include="$(VSIXRootDir)Resources\VSPackage.resx">

vsix/Dev17/vsix.Dev17.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@
168168
</Generator>
169169
</EmbeddedResource>
170170
</ItemGroup>
171+
<ItemGroup>
172+
<PackageReference Include="System.Text.Json" Version="6.0.10" />
173+
</ItemGroup>
171174
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
172175
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
173176
<Import Project="..\Extension.targets" />

0 commit comments

Comments
 (0)