//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// UserRTX.NET satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Runtime.InteropServices;

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

/// <summary>
/// Platform information
/// </summary>
public static class platform {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static int Bitness =>
   IntPtr.Size * 8;

//--------------------------------------------------------------------------------------------------

public static bool IsWin32 =>
   Environment.OSVersion.Platform == PlatformID.Win32NT;

//--------------------------------------------------------------------------------------------------

public static bool IsWindowsOS =>
   RuntimeInformation.IsOSPlatform( OSPlatform.Windows );

public static bool IsOSX =>
   RuntimeInformation.IsOSPlatform( OSPlatform.OSX );

public static bool IsUnixLikeOS =>
   RuntimeInformation.IsOSPlatform( OSPlatform.Linux ) ||
   RuntimeInformation.IsOSPlatform( OSPlatform.FreeBSD );

public static bool IsLinuxOS =>
   RuntimeInformation.IsOSPlatform( OSPlatform.Linux );
public static bool IsFreeBSD =>
   RuntimeInformation.IsOSPlatform( OSPlatform.FreeBSD );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // platform

} // user_rtx (.wasm)
