Skip to content

Commit 250a939

Browse files
authored
Merge pull request #1328 from Unity-Technologies/unity-master-fix-case-1267836
[corlib] Use Environment.Platform to access the platform, rather than…
2 parents aa39a42 + 54c0b93 commit 250a939

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

mcs/class/corlib/System.Runtime.InteropServices.RuntimeInformation/RuntimeInformation.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ public static string FrameworkDescription {
4343

4444
public static bool IsOSPlatform (OSPlatform osPlatform)
4545
{
46-
switch (Environment.OSVersion.Platform) {
46+
switch (Environment.Platform) {
4747
case PlatformID.Win32NT:
4848
return osPlatform == OSPlatform.Windows;
49+
case PlatformID.MacOSX:
50+
return osPlatform == OSPlatform.OSX;
4951
case PlatformID.Unix:
50-
if (File.Exists ("/usr/lib/libc.dylib"))
51-
return osPlatform == OSPlatform.OSX;
52-
5352
return osPlatform == OSPlatform.Linux;
5453
default:
5554
return false;

mcs/class/corlib/System/Environment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public static string NewLine {
214214
//
215215
static OperatingSystem os;
216216

217-
static extern PlatformID Platform {
217+
static internal PlatformID Platform {
218218
[MethodImplAttribute (MethodImplOptions.InternalCall)]
219219
get;
220220
}

0 commit comments

Comments
 (0)