diff --git a/Directory.Build.targets b/Directory.Build.targets index e6457e6111c..c46b686c543 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -9,6 +9,7 @@ + @@ -24,7 +25,7 @@ $(ProductVersion) $(ProductVersion)-$(VersionSuffix) - + + + diff --git a/eng/Versions.props b/eng/Versions.props index 9d3af13f336..48e36672340 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -168,6 +168,8 @@ 9.0.1-alpha.1.21253.1 9.0.1-alpha.1.21253.1 9.0.1-alpha.1.21253.1 + + 1.0.0-alpha.21258.2 diff --git a/eng/generators.targets b/eng/generators.targets new file mode 100644 index 00000000000..77d07da6fb1 --- /dev/null +++ b/eng/generators.targets @@ -0,0 +1,35 @@ + + + + + + + + true + + + + + + + + + + + + + + true + + + true + true + + + + diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs b/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs new file mode 100644 index 00000000000..b04c9d9482b --- /dev/null +++ b/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable + +// +// Types in this file are used for generated p/invokes (docs/design/features/source-generator-pinvokes.md). +// See the DllImportGenerator experiment in https://github.com/dotnet/runtimelab. +// +namespace System.Runtime.InteropServices +{ + /// + /// Indicates that method will be generated at compile time and invoke into an unmanaged library entry point + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] + internal sealed class GeneratedDllImportAttribute : Attribute + { + public bool BestFitMapping { get; set; } + public CallingConvention CallingConvention { get; set; } + public CharSet CharSet { get; set; } + public string? EntryPoint { get; set; } + public bool ExactSpelling { get; set; } + public bool PreserveSig { get; set; } + public bool SetLastError { get; set; } + public bool ThrowOnUnmappableChar { get; set; } + + public GeneratedDllImportAttribute(string dllName) + { + this.Value = dllName; + } + + public string Value { get; private set; } + } +} diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs b/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs new file mode 100644 index 00000000000..c66605e02ed --- /dev/null +++ b/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs @@ -0,0 +1,41 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// +// Types in this file are used for generated p/invokes (docs/design/features/source-generator-pinvokes.md). +// See the DllImportGenerator experiment in https://github.com/dotnet/runtimelab. +// +namespace System.Runtime.InteropServices +{ + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] + internal class GeneratedMarshallingAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Struct)] + internal class BlittableTypeAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)] + internal class NativeMarshallingAttribute : Attribute + { + public NativeMarshallingAttribute(Type nativeType) + { + NativeType = nativeType; + } + + public Type NativeType { get; } + } + + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.Field)] + internal class MarshalUsingAttribute : Attribute + { + public MarshalUsingAttribute(Type nativeType) + { + NativeType = nativeType; + } + + public Type NativeType { get; } + } +}