-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathHelper.cs
More file actions
52 lines (48 loc) · 1.29 KB
/
Copy pathHelper.cs
File metadata and controls
52 lines (48 loc) · 1.29 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace MemoryModule.Tests
{
internal static class Helper
{
#if WINDOWS
public const string ModuleName = "MemoryModule.Compact.Windows.Tests";
#else
public const string ModuleName = "MemoryModule.Tests";
#endif
public static string GetDllName(string displayName)
{
return $"{displayName}{(Environment.Is64BitProcess ? "64" : "")}.{GetDllExtension()}";
}
public static string GetDllExtension()
{
#if WINDOWS
return "dll";
#else
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return "dll";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return "so";
}
else
{
throw new PlatformNotSupportedException("Unsupported platform.");
}
#endif
}
public static void PrintEnvironmentDetails()
{
#if WINDOWS
#else
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Console.WriteLine($"glibc version: {GlibcInterop.GlibcEnvironment.Version}");
}
#endif
}
}
}