Skip to content

Commit ea510df

Browse files
committed
Images and PDF: explicitly use WIC2
Explicitly specify the version of the Windows Imaging Component to avoid an ambiguous reference. Swift recently introduced the ability to import aliasing macros. This now creates a second wrapper declaration that overloads the unversioned alias. Windows 10 implicitly uses the new version, so we can expand that macro manually and avoid the ambiguous reference.
1 parent 893ab63 commit ea510df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftWin32/Images and PDF/Image.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import CoreGraphics
99
#endif
1010

1111
private let WICImagingFactory: SwiftCOM.IWICImagingFactory? =
12-
try? IWICImagingFactory.CreateInstance(class: CLSID_WICImagingFactory)
12+
try? IWICImagingFactory.CreateInstance(class: CLSID_WICImagingFactory2)
1313

1414
extension Image {
1515
/// A configuration object that contains the traits that the system uses when

0 commit comments

Comments
 (0)