Skip to content

Commit

Permalink
Prefer use of OperatingSystem.IsXYZ() APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Oct 23, 2024
1 parent 2c4ce8a commit b5ab1d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/NetVips/ModuleInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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";
}
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit b5ab1d1

Please sign in to comment.