forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlatform.cs
More file actions
39 lines (34 loc) · 959 Bytes
/
Platform.cs
File metadata and controls
39 lines (34 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
namespace LibGit2Sharp.Core
{
internal enum OperatingSystemType
{
Windows,
Unix,
MacOSX
}
internal static class Platform
{
public static string ProcessorArchitecture
{
get { return Environment.Is64BitProcess ? "amd64" : "x86"; }
}
public static OperatingSystemType OperatingSystem
{
get
{
// See http://www.mono-project.com/docs/faq/technical/#how-to-detect-the-execution-platform
switch ((int)Environment.OSVersion.Platform)
{
case 4:
case 128:
return OperatingSystemType.Unix;
case 6:
return OperatingSystemType.MacOSX;
default:
return OperatingSystemType.Windows;
}
}
}
}
}