[vlc-commits] [Git][videolan/vlc][master] access: keep screen capture module compiling on macOS 15+
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri Apr 10 20:14:42 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
a29072fa by Alexandre Janniaux at 2026-04-10T22:02:18+02:00
access: keep screen capture module compiling on macOS 15+
When targeting macOS 15+, CGDisplayCreateImageForRect is marked as
obsoleted and it breaks compilation, even though we build dynamic
modules and the API is still there.
To prevent that, override the SCREEN_CAPTURE_OBSOLETE macro to strip the
obsoleted attribute while preserving the introduced and deprecated
attributes.
This lets the module compile on macOS 15+ SDKs with a deprecation
warning.
- - - - -
1 changed file:
- modules/access/screen/mac.c
Changes:
=====================================
modules/access/screen/mac.c
=====================================
@@ -36,6 +36,16 @@
#import "screen.h"
+/* CGDisplayCreateImageForRect is marked obsoleted=15.0 via the
+ * SCREEN_CAPTURE_OBSOLETE macro (defined in CGWindow.h), which
+ * prevents compilation on macOS 15+ SDKs. Override the macro to
+ * drop the obsoleted attribute while keeping introduced/deprecated,
+ * so the module still compiles as a plugin and loads at runtime. */
+#include <CoreGraphics/CGWindow.h>
+#undef SCREEN_CAPTURE_OBSOLETE
+#define SCREEN_CAPTURE_OBSOLETE(x,y,z) \
+ __attribute__((availability(macos,introduced=x,deprecated=y)));
+#include <CoreGraphics/CGDirectDisplay.h>
#import <ApplicationServices/ApplicationServices.h>
#import <QuartzCore/QuartzCore.h>
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a29072fa19d650ff35dbd8029271624670a41d1e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a29072fa19d650ff35dbd8029271624670a41d1e
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list