[macOS] Fix building with Xcode versions older than 26.

This commit is contained in:
Pāvels Nadtočajevs 2026-03-04 13:13:40 +02:00
parent c0ebded926
commit 41c6075002
No known key found for this signature in database
GPG key ID: 8413210218EF35D2

View file

@ -163,11 +163,15 @@ bool DisplayServerMacOSBase::clipboard_has_image() const {
}
CGDirectDisplayID DisplayServerMacOSBase::_get_display_id_for_screen(NSScreen *p_screen) {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 260000
if (@available(macOS 26.0, *)) {
return [p_screen CGDirectDisplayID];
} else {
return [[p_screen deviceDescription][@"NSScreenNumber"] unsignedIntValue];
}
#else
return [[p_screen deviceDescription][@"NSScreenNumber"] unsignedIntValue];
#endif
}
void DisplayServerMacOSBase::initialize_tts() const {