Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/libraries/Common/tests/System/Drawing/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public static bool GetIsWindowsOrAtLeastLibgdiplus6()
{
installedVersion = new Version(GetLibgdiplusVersion());
}
catch (DllNotFoundException)
{
return false;
}
catch (EntryPointNotFoundException)
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,20 @@ internal unsafe partial class Gdip

internal static IntPtr LoadNativeLibrary()
{
string libraryName;
var assembly = System.Reflection.Assembly.GetExecutingAssembly();

IntPtr lib = IntPtr.Zero;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
libraryName = "libgdiplus.dylib";

var assembly = System.Reflection.Assembly.GetExecutingAssembly();
NativeLibrary.TryLoad(libraryName, assembly, default, out lib);
NativeLibrary.TryLoad("libgdiplus.dylib", assembly, default, out lib);
}
else
{
// Various Unix package managers have chosen different names for the "libgdiplus" shared library.
// The mono project, where libgdiplus originated, allowed both of the names below to be used, via
// a global configuration setting. We prefer the "unversioned" shared object name, and fallback to
// the name suffixed with ".0".
libraryName = "libgdiplus.so";

var assembly = System.Reflection.Assembly.GetExecutingAssembly();
if (!NativeLibrary.TryLoad(libraryName, assembly, default, out lib))
if (!NativeLibrary.TryLoad("libgdiplus.so", assembly, default, out lib))
{
NativeLibrary.TryLoad("libgdiplus.so.0", assembly, default, out lib);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<Compile Include="mono\System.Drawing.Imaging\GifCodecTests.cs" />
<Compile Include="mono\System.Drawing.Imaging\IconCodecTests.cs" />
<Compile Include="mono\System.Drawing.Imaging\JpegCodecTests.cs" />
<Compile Include="mono\System.Drawing.Imaging\PngCodecTesst.cs" />
<Compile Include="mono\System.Drawing.Imaging\PngCodecTests.cs" />
<Compile Include="mono\System.Drawing.Imaging\TiffCodecTests.cs" />
<Compile Include="mono\System.Drawing\GraphicsTests.cs" />
<Compile Include="mono\System.Imaging\MetafileTest.cs" />
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<Compile Include="SurrogateSelectorTests.cs" />
<Compile Include="TargetFrameworkMoniker.cs" />
<Compile Include="TypeSerializableValue.cs" />
<Compile Include="$(CommonTestPath)System\Drawing\Helpers.cs">
<Link>Common\System\Drawing\Helpers.cs</Link>
</Compile>
<Compile Include="$(CommonTestPath)System\NonRuntimeType.cs">
<Link>Common\System\NonRuntimeType.cs</Link>
</Compile>
Expand Down