mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-09 13:05:37 +00:00
Made unix kernel detection less strict. The program is now allowed to run even the specific kernel name is unknown. Partly fixes issue [#1382]: "OpenTK and other Unix OS".
This commit is contained in:
parent
9cb660bf85
commit
b96aaabcae
|
@ -53,25 +53,26 @@ namespace OpenTK
|
||||||
else if (System.Environment.OSVersion.Platform == PlatformID.Unix ||
|
else if (System.Environment.OSVersion.Platform == PlatformID.Unix ||
|
||||||
System.Environment.OSVersion.Platform == (PlatformID)4)
|
System.Environment.OSVersion.Platform == (PlatformID)4)
|
||||||
{
|
{
|
||||||
|
// Distinguish between Linux, Mac OS X and other Unix operating systems.
|
||||||
// Distinguish between Unix and Mac OS X kernels.
|
string kernel_name = DetectUnixKernel();
|
||||||
switch (DetectUnixKernel())
|
switch (kernel_name)
|
||||||
{
|
{
|
||||||
case "Unix":
|
case null:
|
||||||
runningOnUnix = true;
|
case "":
|
||||||
break;
|
throw new PlatformNotSupportedException(
|
||||||
|
"Unknown platform. Please file a bug report at http://www.opentk.com/node/add/project-issue/opentk");
|
||||||
case "Linux":
|
|
||||||
runningOnLinux = runningOnUnix = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Darwin":
|
|
||||||
runningOnMacOS = runningOnUnix = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
case "Linux":
|
||||||
throw new PlatformNotSupportedException(
|
runningOnLinux = runningOnUnix = true;
|
||||||
DetectUnixKernel() + ": Unknown Unix platform. Please report this error at http://www.opentk.com.");
|
break;
|
||||||
|
|
||||||
|
case "Darwin":
|
||||||
|
runningOnMacOS = runningOnUnix = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
runningOnUnix = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -178,7 +179,7 @@ namespace OpenTK
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Detects the unix kernel by p/invoking the uname call in libc.
|
/// Detects the unix kernel by p/invoking uname (libc).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static string DetectUnixKernel()
|
private static string DetectUnixKernel()
|
||||||
|
|
Loading…
Reference in a new issue