-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Closed
Copy link
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Runtime.CompilerServices
Milestone
Description
Background and Motivation
With .NET 5, we're going to be adding support for a new CallKind
bit (tracked here: #38133). From the compiler side, we need a feature flag to know when the target platform supports that bit, so we can error in cases when it's not supported (like we do with DIMs).
Proposed API
namespace System.Runtime.CompilerServices
{
public static partial class RuntimeFeature
{
/// <summary>
/// Name of the Portable PDB feature.
/// </summary>
public const string PortablePdb = nameof(PortablePdb);
#if FEATURE_DEFAULT_INTERFACES
/// <summary>
/// Indicates that this version of runtime supports default interface method implementations.
/// </summary>
public const string DefaultImplementationsOfInterfaces = nameof(DefaultImplementationsOfInterfaces);
#endif
+ /// <summary>
+ /// Indicates that this version of runtime supports the platform default calling convention.
+ /// </summary>
+ public const string UnmanagedSignatureCallingConvention = nameof(UnmanagedSignatureCallingConvention);
/// <summary>
/// Checks whether a certain feature is supported by the Runtime.
/// </summary>
public static bool IsSupported(string feature)
{
switch (feature)
{
case PortablePdb:
+ case UnmanagedSignatureCallingConvention:
#if FEATURE_DEFAULT_INTERFACES
case DefaultImplementationsOfInterfaces:
#endif
return true;
case nameof(IsDynamicCodeSupported):
return IsDynamicCodeSupported;
case nameof(IsDynamicCodeCompiled):
return IsDynamicCodeCompiled;
}
return false;
}
}
}
Usage Examples
In the C# compiler for determining errors.
Alternative Designs
N/A
Risks
N/A
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Runtime.CompilerServices