From 26cb16619dd72d3c4a44c0d41a5fda9e1ff50e56 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Sat, 11 Jul 2020 00:06:56 +0200 Subject: [PATCH] Update Environment.OSVersion for browser platform (#38790) * Update Environment.OSVersion for browser platform * Reflect api review --- .../src/System.Private.CoreLib.Shared.projitems | 5 ++++- .../src/System/Environment.OSVersion.Browser.cs | 14 ++++++++++++++ .../System.Private.CoreLib/src/System/PlatformID.cs | 3 ++- src/libraries/System.Runtime/ref/System.Runtime.cs | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index a5422ab..983a30c 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -1792,7 +1792,7 @@ - + @@ -1818,6 +1818,9 @@ + + + Common\Interop\OSX\Interop.libobjc.cs diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs new file mode 100644 index 0000000..9dd80cb --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs @@ -0,0 +1,14 @@ +// 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. + +namespace System +{ + public static partial class Environment + { + private static OperatingSystem GetOSVersion() + { + return new OperatingSystem(PlatformID.Other, new Version(1, 0, 0, 0)); + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/PlatformID.cs b/src/libraries/System.Private.CoreLib/src/System/PlatformID.cs index 31e9210..475cdc4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/PlatformID.cs +++ b/src/libraries/System.Private.CoreLib/src/System/PlatformID.cs @@ -13,6 +13,7 @@ namespace System [EditorBrowsable(EditorBrowsableState.Never)] WinCE = 3, Unix = 4, [EditorBrowsable(EditorBrowsableState.Never)] Xbox = 5, - [EditorBrowsable(EditorBrowsableState.Never)] MacOSX = 6 + [EditorBrowsable(EditorBrowsableState.Never)] MacOSX = 6, + Other = 7 } } diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 388eeea..0baf640 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -3077,6 +3077,7 @@ namespace System Xbox = 5, [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] MacOSX = 6, + Other = 7, } public partial class PlatformNotSupportedException : System.NotSupportedException { -- 2.7.4