-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade our .NET SDK to 5.0 RC 1 #48404
Changes from all commits
aaff726
c756744
81457f2
d95d411
a30757d
d9f6465
1cb96c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -502,12 +502,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic | |
#If DEBUG Then | ||
' Compile time asserts. | ||
Private Const s_delegateRelaxationLevelMask_AssertZero = SmallFieldMask.DelegateRelaxationLevelMask - ConversionKind.DelegateRelaxationLevelMask | ||
Private _delegateRelaxationLevelMask_Assert1(s_delegateRelaxationLevelMask_AssertZero) As Boolean | ||
Private _delegateRelaxationLevelMask_Assert2(-s_delegateRelaxationLevelMask_AssertZero) As Boolean | ||
Private ReadOnly _delegateRelaxationLevelMask_Assert1(s_delegateRelaxationLevelMask_AssertZero) As Boolean | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The IDE Analyzer MakeFieldReadOnly is already enabled. Why it didn't catch these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The updated analyzer catches more cases. |
||
Private ReadOnly _delegateRelaxationLevelMask_Assert2(-s_delegateRelaxationLevelMask_AssertZero) As Boolean | ||
|
||
Private Const s_inferenceLevelMask_AssertZero = CByte((SmallFieldMask.InferenceLevelMask >> SmallFieldMask.InferenceLevelShift) <> ((TypeArgumentInference.InferenceLevel.Invalid << 1) - 1)) | ||
Private _inferenceLevelMask_Assert1(s_inferenceLevelMask_AssertZero) As Boolean | ||
Private _inferenceLevelMask_Assert2(-s_inferenceLevelMask_AssertZero) As Boolean | ||
Private ReadOnly _inferenceLevelMask_Assert1(s_inferenceLevelMask_AssertZero) As Boolean | ||
Private ReadOnly _inferenceLevelMask_Assert2(-s_inferenceLevelMask_AssertZero) As Boolean | ||
#End If | ||
Public Structure OptionalArgument | ||
Public ReadOnly DefaultValue As BoundExpression | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.Versioning; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
@@ -13,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Interactive | |
{ | ||
internal static class InteractiveHostEntryPoint | ||
{ | ||
[SupportedOSPlatform("windows")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be surrounded by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to localize the directives to PlatformAttributes.cs and have the code itself look uniform and, where possible, modern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there not a constant for these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see one. dotnet/runtime seems to use strings. |
||
private static async Task<int> Main(string[] args) | ||
{ | ||
FatalError.Handler = FailFast.OnFatalException; | ||
|
@@ -51,9 +53,11 @@ private static async Task<int> Main(string[] args) | |
} | ||
} | ||
|
||
[SupportedOSPlatform("windows")] | ||
[DllImport("kernel32", PreserveSig = true)] | ||
internal static extern ErrorMode SetErrorMode(ErrorMode mode); | ||
|
||
[SupportedOSPlatform("windows")] | ||
[DllImport("kernel32", PreserveSig = true)] | ||
internal static extern ErrorMode GetErrorMode(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the next line for
xcopy-msbuild
be updated to preview 3 instead of preview 2?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@333fred?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I think the answer is no because we only rebuild that xcopy package when we need to...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only do it when we need to, but the likelihood is that we'll need to. @jaredpar, is there a new version? If not, can you make one?