diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index ac73beb0c03e3..62cc6527848c1 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -1016,6 +1016,7 @@ + @@ -2721,4 +2722,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WasmImportLinkageAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WasmImportLinkageAttribute.cs new file mode 100644 index 0000000000000..e498e0d874cc5 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WasmImportLinkageAttribute.cs @@ -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 +{ + /// + /// Specifies that the P/Invoke marked with this attribute should be linked in as a WASM import. + /// + /// + /// See https://webassembly.github.io/spec/core/syntax/modules.html#imports. + /// + [AttributeUsage(AttributeTargets.Method, Inherited = false)] + public sealed class WasmImportLinkageAttribute : Attribute + { + /// + /// Instance constructor. + /// + public WasmImportLinkageAttribute() { } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index 59dfcf2713620..7126b3877521e 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -1711,6 +1711,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 {