Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enforce libgdiplus version on macOS
  • Loading branch information
qmfrederik committed Feb 14, 2020
commit 9dfe4906be565a0f86a2c2735cff63f92ffb45dd
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,25 @@ private static void PlatformInitialize()
LibraryResolver.EnsureRegistered();

// Check whether the version of libgdiplus is a recent version of libgdiplus.
Version installedVersion = null;

try
{
installedVersion = new Version(GetLibgdiplusVersion());
}
catch (EntryPointNotFoundException)
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// We're using an old version of libgdiplus, which doesn't implement the GetLibgdiplusVersion
// version.
throw new PlatformNotSupportedException(SR.Format(SR.LibgdiplusOutdated, LibraryRequiredVersion));
}
Version installedVersion = null;

if (installedVersion < LibraryRequiredVersion)
{
throw new PlatformNotSupportedException(SR.Format(SR.LibgdiplusOutdated2, LibraryRequiredVersion, installedVersion));
try
{
installedVersion = new Version(GetLibgdiplusVersion());
}
catch (EntryPointNotFoundException)
{
// We're using an old version of libgdiplus, which doesn't implement the GetLibgdiplusVersion
// version.
throw new PlatformNotSupportedException(SR.Format(SR.LibgdiplusOutdated, LibraryRequiredVersion));
}

if (installedVersion < LibraryRequiredVersion)
{
throw new PlatformNotSupportedException(SR.Format(SR.LibgdiplusOutdated2, LibraryRequiredVersion, installedVersion));
}
}
}

Expand Down