static UnixLoader() { var buffer = Marshal.AllocHGlobal(0x1000); uname(buffer); var unixName = Marshal.PtrToStringAnsi(buffer); Marshal.FreeHGlobal(buffer); if (unixName == "Darwin") { OsXImports.Init(); } else { LinuxImports.Init(); } }
static UnixLoader() { var buffer = Marshal.AllocHGlobal(0x1000); uname(buffer); var unixName = Marshal.PtrToStringAnsi(buffer); Marshal.FreeHGlobal(buffer); if (unixName == "Darwin") { OsXImports.Init(); } #if NET6_0_OR_GREATER else if (OperatingSystem.IsAndroid()) { AndroidImports.Init(); } #endif else { LinuxImports.Init(); } }