Availability warning when building Gtk4 on macOS
[118/1523] Compiling C object gdk/macos/libgdk-macos.a.p/gdkmacosmonitor.c.o
../../src/gtk-4.2.0/gdk/macos/gdkmacosmonitor.c:156:17: warning: 'localizedName' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
str = [screen localizedName];
^~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSScreen.h:56:38: note: 'localizedName' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.13.0
@property (readonly, copy) NSString *localizedName API_AVAILABLE(macos(10.15));
^
../../src/gtk-4.2.0/gdk/macos/gdkmacosmonitor.c:156:17: note: enclose 'localizedName' in an @available check to silence this warning
str = [screen localizedName];
^~~~~~~~~~~~~~
The string is passed to gdk_monitor_set_model()
. Perhaps it would be better to make a string from CGDisplayModelNumber, available since Mac OS X 10.2.
Edited by John Ralls