Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Parfenov <[email protected]>
  • Loading branch information
Andrey1994 committed Nov 7, 2023
1 parent b2e080e commit 739de22
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions csharp_package/brainflow/brainflow/platform_helper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;

using System.Runtime.InteropServices;

namespace brainflow
{
Expand All @@ -18,28 +18,28 @@ public static LibraryEnvironment get_library_environment ()
{
if (library_env == LibraryEnvironment.Unknown)
{
switch (Environment.OSVersion.Platform)
if (RuntimeInformation.IsOSPlatform (OSPlatform.Linux))
{
Console.Error.Write ("Linux platform detected");
library_env = LibraryEnvironment.x64;
}
if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX))
{
Console.Error.Write ("OSX platform detected");
library_env = LibraryEnvironment.MacOS;
}
if (RuntimeInformation.IsOSPlatform (OSPlatform.Windows))
{
case PlatformID.MacOSX:
library_env = LibraryEnvironment.MacOS;
Console.Error.Write ("MacOS platform detected");
break;
case PlatformID.Unix:
library_env = LibraryEnvironment.Linux;
Console.Error.Write ("Linux platform detected");
break;
default:
if (Environment.Is64BitProcess)
{
Console.Error.Write ("Win64 platform detected");
library_env = LibraryEnvironment.x64;
}
else
{
Console.Error.Write ("Win32 platform detected");
library_env = LibraryEnvironment.x86;
}
break;
if (Environment.Is64BitProcess)
{
Console.Error.Write ("Win64 platform detected");
library_env = LibraryEnvironment.x64;
}
else
{
Console.Error.Write ("Win32 platform detected");
library_env = LibraryEnvironment.x86;
}
}
}

Expand Down

0 comments on commit 739de22

Please sign in to comment.