From 20cd393c1e577f0ff53cdc3a00edc3bcfc68ab7f Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 13 May 2022 14:52:07 -0700 Subject: [PATCH] Expose the RuntimeFeature.NumericIntPtr member for C# 11 (#69322) --- .../src/System/Runtime/CompilerServices/RuntimeFeature.cs | 6 ++++++ src/libraries/System.Runtime/ref/System.Runtime.cs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs index 0c16cd1315a4..e69436494251 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs @@ -37,6 +37,11 @@ public static partial class RuntimeFeature /// public const string VirtualStaticsInInterfaces = nameof(VirtualStaticsInInterfaces); + /// + /// Indicates that this version of runtime supports and as numeric types. + /// + public const string NumericIntPtr = nameof(NumericIntPtr); + /// /// Checks whether a certain feature is supported by the Runtime. /// @@ -50,6 +55,7 @@ public static bool IsSupported(string feature) case UnmanagedSignatureCallingConvention: case DefaultImplementationsOfInterfaces: case VirtualStaticsInInterfaces: + case NumericIntPtr: return true; case nameof(IsDynamicCodeSupported): return IsDynamicCodeSupported; diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index feb44b077a59..0bc858163871 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -11817,6 +11817,7 @@ public static partial class RuntimeFeature public const string ByRefFields = "ByRefFields"; public const string CovariantReturnsOfClasses = "CovariantReturnsOfClasses"; public const string DefaultImplementationsOfInterfaces = "DefaultImplementationsOfInterfaces"; + public const string NumericIntPtr = "NumericIntPtr"; public const string PortablePdb = "PortablePdb"; public const string UnmanagedSignatureCallingConvention = "UnmanagedSignatureCallingConvention"; public const string VirtualStaticsInInterfaces = "VirtualStaticsInInterfaces";