Add [UnmanagedCallersOnly] polyfill type

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-08 18:43:57 +01:00
1 親 e14c91f429
コミット 0e8b2fd02b
3ファイル変更
+42 -36

検索条件に一致するファイルはありません

+1
ファイルの表示
@@ -22,6 +22,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\SkipLocalsInitAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\MemoryMarshal.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeHelpers.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\UnmanagedCallersOnlyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\NativeMemory.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\OSPlatformAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\SupportedOSVersionAttribute.cs" />
@@ -0,0 +1,14 @@
using System;
namespace ComputeSharp.NetStandard.System.Runtime.InteropServices;
/// <summary>
/// Any method marked with <see cref="UnmanagedCallersOnlyAttribute" /> can be directly called from native code.
/// </summary>
/// <remarks>
/// This polyfill is deliberately in the wrong namespace to avoid the C# compiler failing to build below .NET 5.
/// </remarks>
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
public sealed class UnmanagedCallersOnlyAttribute : Attribute
{
}