mirror of
https://github.com/chylex/.NET-Community-Toolkit.git
synced 2025-08-13 16:17:00 +02:00
Add [SkipLocalsInit] to missing assemblies
This commit is contained in:
CommunityToolkit.Common
CommunityToolkit.Diagnostics
CommunityToolkit.Mvvm/Properties
@@ -0,0 +1,27 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#if !NET6_0_OR_GREATER
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Used to indicate to the compiler that the <c>.locals init</c> flag should not be set in method headers.
|
||||
/// </summary>
|
||||
/// <remarks>Internal copy of the .NET 5 attribute.</remarks>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Module |
|
||||
AttributeTargets.Class |
|
||||
AttributeTargets.Struct |
|
||||
AttributeTargets.Interface |
|
||||
AttributeTargets.Constructor |
|
||||
AttributeTargets.Method |
|
||||
AttributeTargets.Property |
|
||||
AttributeTargets.Event,
|
||||
Inherited = false)]
|
||||
internal sealed class SkipLocalsInitAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
8
CommunityToolkit.Common/Properties/AssemblyInfo.cs
Normal file
8
CommunityToolkit.Common/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// See notes in CommunityToolkit.HighPerformance for more info
|
||||
[module: SkipLocalsInit]
|
@@ -41,7 +41,6 @@ public static class ValueTypeExtensions
|
||||
/// Console.WriteLine((-1).ToHexString()); // "0xFFFFFFFF"
|
||||
/// </code>
|
||||
/// </remarks>
|
||||
[SkipLocalsInit]
|
||||
public static unsafe string ToHexString<T>(this T value)
|
||||
where T : unmanaged
|
||||
{
|
||||
|
8
CommunityToolkit.Diagnostics/Properties/AssemblyInfo.cs
Normal file
8
CommunityToolkit.Diagnostics/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// See notes in CommunityToolkit.HighPerformance for more info
|
||||
[module: SkipLocalsInit]
|
@@ -4,4 +4,7 @@
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// See notes in CommunityToolkit.HighPerformance for more info
|
||||
[module: SkipLocalsInit]
|
||||
|
||||
[assembly: InternalsVisibleTo("CommunityToolkit.Mvvm.Internals.UnitTests")]
|
@@ -0,0 +1,27 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#if !NET6_0_OR_GREATER
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Used to indicate to the compiler that the <c>.locals init</c> flag should not be set in method headers.
|
||||
/// </summary>
|
||||
/// <remarks>Internal copy from the BCL attribute.</remarks>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Module |
|
||||
AttributeTargets.Class |
|
||||
AttributeTargets.Struct |
|
||||
AttributeTargets.Interface |
|
||||
AttributeTargets.Constructor |
|
||||
AttributeTargets.Method |
|
||||
AttributeTargets.Property |
|
||||
AttributeTargets.Event,
|
||||
Inherited = false)]
|
||||
internal sealed class SkipLocalsInitAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user