Skip to content

Commit

Permalink
Add WasmImportLinkageAttribute (#93823)
Browse files Browse the repository at this point in the history
* Add WasmImportLinkageAttribute

---------

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent 943a50a commit a68243b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\UnmanagedType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\VarEnum.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\VariantWrapper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\WasmImportLinkageAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\ISimdVector_2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\Scalar.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\SimdVectorExtensions.cs" />
Expand Down Expand Up @@ -2736,4 +2737,4 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Numerics\IUnaryPlusOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Numerics\IUnsignedNumber.cs" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Runtime.InteropServices
{
/// <summary>
/// Specifies that the P/Invoke marked with this attribute should be linked in as a WASM import.
/// </summary>
/// <remarks>
/// See https://webassembly.github.io/spec/core/syntax/modules.html#imports.
/// </remarks>
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
public sealed class WasmImportLinkageAttribute : Attribute
{
/// <summary>
/// Instance constructor.
/// </summary>
public WasmImportLinkageAttribute() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,11 @@ public sealed partial class VariantWrapper
public VariantWrapper(object? obj) { }
public object? WrappedObject { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited = false)]
public sealed class WasmImportLinkageAttribute : Attribute
{
public WasmImportLinkageAttribute() { }
}
}
namespace System.Runtime.InteropServices.ComTypes
{
Expand Down

0 comments on commit a68243b

Please sign in to comment.