From b5ab1d1f84b77711174fa5384ad17af99433dd0f Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Wed, 23 Oct 2024 09:46:01 +0200 Subject: [PATCH] Prefer use of `OperatingSystem.IsXYZ()` APIs --- src/NetVips/ModuleInitializer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetVips/ModuleInitializer.cs b/src/NetVips/ModuleInitializer.cs index dac54d6..0037bc1 100644 --- a/src/NetVips/ModuleInitializer.cs +++ b/src/NetVips/ModuleInitializer.cs @@ -46,7 +46,7 @@ internal static string RemapLibraryName(string libraryName) // `libgobject-2.0-0.dll`. Note that this is only possible when // targeting .NET 6 or higher. As a result, we always ship at least // 3 DLLs in a separate package for .NET Framework. - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (OperatingSystem.IsWindows()) { return _gLibStaticallyLinked ? Libraries.Vips : libraryName; } @@ -58,7 +58,7 @@ internal static string RemapLibraryName(string libraryName) // single shared library with all dependencies statically linked // without breaking compatibility with the shared builds // (i.e. what is usually installed via package managers). - return RuntimeInformation.IsOSPlatform(OSPlatform.OSX) + return OperatingSystem.IsMacOS() ? "libvips.42.dylib" : "libvips.so.42"; } @@ -104,7 +104,7 @@ public static void Initialize() Version = (Version << 8) + NetVips.Version(2, false); #if NET6_0_OR_GREATER - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return; + if (!OperatingSystem.IsWindows()) return; try {