[PATCH] ui/cocoa.m: Drop old macOS-10.12-and-earlier compat ifdefs

Peter Maydell posted 1 patch 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240502142904.62644-1-peter.maydell@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Akihiko Odaki <akihiko.odaki@daynix.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
ui/cocoa.m | 13 -------------
1 file changed, 13 deletions(-)
[PATCH] ui/cocoa.m: Drop old macOS-10.12-and-earlier compat ifdefs
Posted by Peter Maydell 2 weeks, 1 day ago
We only support the most recent two versions of macOS (currently
macOS 13 Ventura and macOS 14 Sonoma), and our ui/cocoa.m code
already assumes at least macOS 12 Monterey or better, because it uses
NSScreen safeAreaInsets, which is 12.0-or-newer.

Remove the ifdefs that were providing backwards compatibility for
building on 10.12 and earlier versions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 ui/cocoa.m | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 25e0db9dd0b..981615a8b92 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -50,23 +50,10 @@
 #include <Carbon/Carbon.h>
 #include "hw/core/cpu.h"
 
-#ifndef MAC_OS_X_VERSION_10_13
-#define MAC_OS_X_VERSION_10_13 101300
-#endif
-
 #ifndef MAC_OS_VERSION_14_0
 #define MAC_OS_VERSION_14_0 140000
 #endif
 
-/* 10.14 deprecates NSOnState and NSOffState in favor of
- * NSControlStateValueOn/Off, which were introduced in 10.13.
- * Define for older versions
- */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
-#define NSControlStateValueOn NSOnState
-#define NSControlStateValueOff NSOffState
-#endif
-
 //#define DEBUG
 
 #ifdef DEBUG
-- 
2.34.1
Re: [PATCH] ui/cocoa.m: Drop old macOS-10.12-and-earlier compat ifdefs
Posted by Philippe Mathieu-Daudé 2 weeks ago
On 2/5/24 16:29, Peter Maydell wrote:
> We only support the most recent two versions of macOS (currently
> macOS 13 Ventura and macOS 14 Sonoma), and our ui/cocoa.m code
> already assumes at least macOS 12 Monterey or better, because it uses
> NSScreen safeAreaInsets, which is 12.0-or-newer.
> 
> Remove the ifdefs that were providing backwards compatibility for
> building on 10.12 and earlier versions.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   ui/cocoa.m | 13 -------------
>   1 file changed, 13 deletions(-)

Thanks, patch queued.
Re: [PATCH] ui/cocoa.m: Drop old macOS-10.12-and-earlier compat ifdefs
Posted by Daniel P. Berrangé 2 weeks, 1 day ago
On Thu, May 02, 2024 at 03:29:04PM +0100, Peter Maydell wrote:
> We only support the most recent two versions of macOS (currently
> macOS 13 Ventura and macOS 14 Sonoma), and our ui/cocoa.m code
> already assumes at least macOS 12 Monterey or better, because it uses
> NSScreen safeAreaInsets, which is 12.0-or-newer.
> 
> Remove the ifdefs that were providing backwards compatibility for
> building on 10.12 and earlier versions.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  ui/cocoa.m | 13 -------------
>  1 file changed, 13 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|