Remove deprecation warning of graphicsContextWithWindow used with macOS ≤ 10.13

This commit is contained in:
ManoloFLTK 2025-09-08 12:44:55 +02:00
parent 27e02a1541
commit b69286f2ca

View File

@ -3689,8 +3689,12 @@ void Fl_Cocoa_Window_Driver::make_current()
} else } else
#endif #endif
{ {
// ignore deprecation warning of "graphicsContextWithWindow" because used only with 10.13 or before
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSGraphicsContext *nsgc = (through_drawRect ? [NSGraphicsContext currentContext] : NSGraphicsContext *nsgc = (through_drawRect ? [NSGraphicsContext currentContext] :
[NSGraphicsContext graphicsContextWithWindow:fl_window]); [NSGraphicsContext graphicsContextWithWindow:fl_window]);
#pragma clang diagnostic pop
static SEL gc_sel = fl_mac_os_version >= 101000 ? @selector(CGContext) : @selector(graphicsPort); static SEL gc_sel = fl_mac_os_version >= 101000 ? @selector(CGContext) : @selector(graphicsPort);
gc = (CGContextRef)[nsgc performSelector:gc_sel]; gc = (CGContextRef)[nsgc performSelector:gc_sel];
} }