Skip to content

Commit

Permalink
Clean up more warnings and Component Governance (#1475)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
DefaultRyan authored Feb 20, 2025
1 parent 4bc0f82 commit 76eb09c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions cppwinrt/component_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noex
}
#ifdef _WRL_MODULE_H_
#pragma warning(suppress: 4324) // structure was padded due to alignment specifier
return ::Microsoft::WRL::Module<::Microsoft::WRL::InProc>::GetModule().GetActivationFactory(static_cast<HSTRING>(classId), reinterpret_cast<::IActivationFactory**>(factory));
#else
return winrt::hresult_class_not_available(name).to_abi();
Expand Down
2 changes: 1 addition & 1 deletion natvis/object_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ std::wstring string_to_wstring(std::string_view const& str)
}

std::wstring result(size, L'?');
auto size_result = MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast<int>(str.size()), result.data(), size);
[[maybe_unused]] auto size_result = MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast<int>(str.size()), result.data(), size);
XLANG_ASSERT(size == size_result);
return result;
}
Expand Down
3 changes: 3 additions & 0 deletions test/old_tests/Component/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
#include "winrt/Composable.h"

// This is used to validate WRL interop support.
#pragma warning(push)
#pragma warning(disable: 4324) // structure was padded due to alignment specifier
#include <wrl.h>
#pragma warning(pop)
1 change: 1 addition & 0 deletions vsix/Dev16/vsix.Dev16.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(VSIXRootDir)Resources\VSPackage.resx">
Expand Down
3 changes: 3 additions & 0 deletions vsix/Dev17/vsix.Dev17.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="6.0.10" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="..\Extension.targets" />
Expand Down

0 comments on commit 76eb09c

Please sign in to comment.