diff options
author | 2016-02-25 15:34:55 -0800 | |
---|---|---|
committer | 2016-02-25 15:34:55 -0800 | |
commit | 8be227840333e3766cbdbc477d7ebc8bfe6c3d10 (patch) | |
tree | cc2029c6ca1a053e44c72f0a3a263fb3e9bf74d9 /src/csharp/Grpc.Core/Internal/PlatformApis.cs | |
parent | ee821bb10bca90c5a39d042349be1f8c8d01a289 (diff) | |
parent | e2a8a3f45ceb63bcb4c039aa2a53cb5deb7d4767 (diff) |
Merge branch 'hide-the-pollset-set' into cleaner-posix2
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/PlatformApis.cs')
-rw-r--r-- | src/csharp/Grpc.Core/Internal/PlatformApis.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/Internal/PlatformApis.cs b/src/csharp/Grpc.Core/Internal/PlatformApis.cs index f0c5b0f63f..fb1acfb607 100644 --- a/src/csharp/Grpc.Core/Internal/PlatformApis.cs +++ b/src/csharp/Grpc.Core/Internal/PlatformApis.cs @@ -53,12 +53,18 @@ namespace Grpc.Core.Internal static PlatformApis() { +#if DNXCORE50 + isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + isMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); +#else var platform = Environment.OSVersion.Platform; // PlatformID.MacOSX is never returned, commonly used trick is to identify Mac is by using uname. isMacOSX = (platform == PlatformID.Unix && GetUname() == "Darwin"); isLinux = (platform == PlatformID.Unix && !isMacOSX); isWindows = (platform == PlatformID.Win32NT || platform == PlatformID.Win32S || platform == PlatformID.Win32Windows); +#endif isMono = Type.GetType("Mono.Runtime") != null; } |