|
|
|
@ -36,6 +36,7 @@ namespace Grpc.Core.Internal |
|
|
|
|
static readonly bool isWindows; |
|
|
|
|
static readonly bool isMono; |
|
|
|
|
static readonly bool isNetCore; |
|
|
|
|
static readonly bool isUnity; |
|
|
|
|
|
|
|
|
|
static PlatformApis() |
|
|
|
|
{ |
|
|
|
@ -54,6 +55,7 @@ namespace Grpc.Core.Internal |
|
|
|
|
isNetCore = false; |
|
|
|
|
#endif |
|
|
|
|
isMono = Type.GetType("Mono.Runtime") != null; |
|
|
|
|
isUnity = Type.GetType("UnityEngine.Application, UnityEngine") != null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static bool IsLinux |
|
|
|
@ -76,6 +78,14 @@ namespace Grpc.Core.Internal |
|
|
|
|
get { return isMono; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// true if running on Unity platform. |
|
|
|
|
/// </summary> |
|
|
|
|
public static bool IsUnity |
|
|
|
|
{ |
|
|
|
|
get { return isUnity; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// true if running on .NET Core (CoreCLR), false otherwise. |
|
|
|
|
/// </summary> |
|
|
|
|