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:34:55 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-02-25 15:34:55 -0800
commit8be227840333e3766cbdbc477d7ebc8bfe6c3d10 (patch)
treecc2029c6ca1a053e44c72f0a3a263fb3e9bf74d9 /src/csharp/Grpc.Core/Internal/PlatformApis.cs
parentee821bb10bca90c5a39d042349be1f8c8d01a289 (diff)
parente2a8a3f45ceb63bcb4c039aa2a53cb5deb7d4767 (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.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;
}