-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48404 from jasonmalinowski/fix-integration-tests
Upgrade our .NET SDK to 5.0 RC 1
- Loading branch information
Showing
7 changed files
with
118 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
src/Compilers/Core/Portable/InternalUtilities/PlatformAttributes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
#nullable enable | ||
|
||
#if !NET5_0 | ||
|
||
namespace System.Runtime.Versioning | ||
{ | ||
/// <summary> | ||
/// Base type for all platform-specific API attributes. | ||
/// </summary> | ||
internal abstract class OSPlatformAttribute : Attribute | ||
{ | ||
private protected OSPlatformAttribute(string platformName) | ||
{ | ||
PlatformName = platformName; | ||
} | ||
|
||
public string PlatformName { get; } | ||
} | ||
|
||
/// <summary> | ||
/// Records the platform that the project targeted. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] | ||
internal sealed class TargetPlatformAttribute : OSPlatformAttribute | ||
{ | ||
public TargetPlatformAttribute(string platformName) | ||
: base(platformName) | ||
{ | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Records the operating system (and minimum version) that supports an API. Multiple attributes can be | ||
/// applied to indicate support on multiple operating systems. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para>Callers can apply a <see cref="SupportedOSPlatformAttribute" /> | ||
/// or use guards to prevent calls to APIs on unsupported operating systems.</para> | ||
/// | ||
/// <para>A given platform should only be specified once.</para> | ||
/// </remarks> | ||
[AttributeUsage( | ||
AttributeTargets.Assembly | ||
| AttributeTargets.Class | ||
| AttributeTargets.Constructor | ||
| AttributeTargets.Enum | ||
| AttributeTargets.Event | ||
| AttributeTargets.Field | ||
| AttributeTargets.Method | ||
| AttributeTargets.Module | ||
| AttributeTargets.Property | ||
| AttributeTargets.Struct, | ||
AllowMultiple = true, Inherited = false)] | ||
internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute | ||
{ | ||
public SupportedOSPlatformAttribute(string platformName) | ||
: base(platformName) | ||
{ | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Marks APIs that were removed in a given operating system version. | ||
/// </summary> | ||
/// <remarks> | ||
/// Primarily used by OS bindings to indicate APIs that are only available in | ||
/// earlier versions. | ||
/// </remarks> | ||
[AttributeUsage( | ||
AttributeTargets.Assembly | ||
| AttributeTargets.Class | ||
| AttributeTargets.Constructor | ||
| AttributeTargets.Enum | ||
| AttributeTargets.Event | ||
| AttributeTargets.Field | ||
| AttributeTargets.Method | ||
| AttributeTargets.Module | ||
| AttributeTargets.Property | ||
| AttributeTargets.Struct, | ||
AllowMultiple = true, Inherited = false)] | ||
internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute | ||
{ | ||
public UnsupportedOSPlatformAttribute(string platformName) | ||
: base(platformName) | ||
{ | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters