PGNewDeviceWithDescriptor is obsolete. Replace with
PGCreateDeviceWIthDescriptor.
Signed-off-by: Yundi Xu<[email protected]>
---
hw/display/apple-gfx.m | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m
index be0061b9db..e730909c7e 100644
--- a/hw/display/apple-gfx.m
+++ b/hw/display/apple-gfx.m
@@ -767,7 +767,24 @@ bool apple_gfx_common_realize(AppleGFXState *s,
DeviceState *dev,
s->cursor_show = true;
+ /*
+ * PGNewDeviceWithDescriptor() was deprecated in macOS 15.2 and removed
+ * in 27.0.
+ *
+ * It is replaced by PGCreateDeviceWithDescriptor(), which is available in
+ * >=15.2
+ */
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 270000
+ s->pgdev = PGCreateDeviceWithDescriptor(desc);
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 150200
+ if (@available(macOS 15.2, *)) {
+ s->pgdev = PGCreateDeviceWithDescriptor(desc);
+ } else {
+ s->pgdev = PGNewDeviceWithDescriptor(desc);
+ }
+#else /* (__MAC_OS_X_VERSION_MAX_ALLOWED >= 150200) */
s->pgdev = PGNewDeviceWithDescriptor(desc);
+#endif /* (__MAC_OS_X_VERSION_MAX_ALLOWED >= 150200) */
disp_desc = apple_gfx_prepare_display_descriptor(s);
/*
---
base-commit: f7ada39edacaa5c26b30e98b94017b0b2ccbcf94
change-id: 20261001-fix-pgcreatedevicewithdescriptor-3ec303c2500a
Best regards,
--
Yundi Xu<[email protected]>