From 9205b38de79d40427f8e1aa56a29553f5f428e88 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 1 Jan 2022 17:50:34 +0100 Subject: [PATCH] Add [SkipLocalsInit] to UWP sample app --- .../ComputeSharp.SwapChain.Uwp.csproj | 1 + .../Properties/AssemblyInfo.cs | 5 ++++- .../Properties/SkipLocalsInitAttribute.cs | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 samples/ComputeSharp.SwapChain.Uwp/Properties/SkipLocalsInitAttribute.cs diff --git a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj index c183283c..477be62b 100644 --- a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj +++ b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj @@ -123,6 +123,7 @@ App.xaml + MainView.xaml diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs b/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs index c199ce78..0ed0ddff 100644 --- a/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs +++ b/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -25,4 +26,6 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file +[assembly: ComVisible(false)] + +[module: SkipLocalsInit] \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/SkipLocalsInitAttribute.cs b/samples/ComputeSharp.SwapChain.Uwp/Properties/SkipLocalsInitAttribute.cs new file mode 100644 index 00000000..894d04db --- /dev/null +++ b/samples/ComputeSharp.SwapChain.Uwp/Properties/SkipLocalsInitAttribute.cs @@ -0,0 +1,16 @@ +namespace System.Runtime.CompilerServices; + +/// +/// Used to indicate to the compiler that the .locals init flag should not be set in method headers. +/// +[AttributeUsage(AttributeTargets.Module + | AttributeTargets.Class + | AttributeTargets.Struct + | AttributeTargets.Interface + | AttributeTargets.Constructor + | AttributeTargets.Method + | AttributeTargets.Property + | AttributeTargets.Event, Inherited = false)] +internal sealed class SkipLocalsInitAttribute : Attribute +{ +} \ No newline at end of file