aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Internal/PlatformApis.cs
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-02-25 15:24:40 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-02-25 15:24:40 -0800
commite2a8a3f45ceb63bcb4c039aa2a53cb5deb7d4767 (patch)
tree28da98bc09e3075e25b2b02c49435131d0601bb7 /src/csharp/Grpc.Core/Internal/PlatformApis.cs
parentc46beaaa29af84f676bde9d013a85dffed1d58c9 (diff)
parent1d7704d7a1ac694fd4f3098437b98f2616368010 (diff)
Merge branch 'hide-the-pollset' into hide-the-pollset-set
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/PlatformApis.cs')
-rw-r--r--src/csharp/Grpc.Core/Internal/PlatformApis.cs6
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;
}