commit b69286f2ca93bdda135cff6189e22d01583c7624
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon Sep 8 12:44:55 2025 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon Sep 8 12:44:55 2025 +0200
Remove deprecation warning of graphicsContextWithWindow used with macOS â?¤ 10.13
src/Fl_cocoa.mm | 4 ++++
1 file changed, 4 insertions(+)
diff --git src/Fl_cocoa.mm src/Fl_cocoa.mm
index 13d536c..59b8829 100644
--- src/Fl_cocoa.mm
+++ src/Fl_cocoa.mm
@@ -3689,8 +3689,12 @@ void Fl_Cocoa_Window_Driver::make_current()
} else
#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 graphicsContextWithWindow:fl_window]);
+#pragma clang diagnostic pop
static SEL gc_sel = fl_mac_os_version >= 101000 ? @selector(CGContext) : @selector(graphicsPort);
gc = (CGContextRef)[nsgc performSelector:gc_sel];
}
[ Direct Link to Message ]