qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support)
@ 2015-05-10 22:19 Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support Peter Maydell
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

This patchset fixes a number of new compile warnings when building
on OSX10.10 which were not present on 10.9, which are mostly fixes
to avoid deprecated APIs.

I've chosen to implement some of them by simply dropping the
backward-compatibility support for OSX 10.4. This is basically
a pragmatic decision since I don't think we can support ancient
versions forever, especially when I don't actually have a system
to test compiling them on. (Last time I tried building QEMU on 10.4
it was an insane pain because you had to start by building all
the dependencies and a new compiler too.) I would not be terribly
surprised somebody told me we'd already accidentally broken 10.4
compilation, in fact.

10.5 is the last PPC OSX release so it seems like a reasonable
minimum-version requirement (though I don't have a 10.5 setup
either, so am reliant on people telling me if it breaks.)

This patchset sits on top of my current cocoa.next branch which
you can find here:
https://git.linaro.org/people/peter.maydell/qemu-arm.git cocoa.next

If you have a pre-10.10 system and can test that this patchset
doesn't break compilation that would be nice. (I checked the
Apple documentation's notes about when functions and constants
were first defined, so it should be OK...)

Peter Maydell (6):
  ui/cocoa: Drop tests for CGImageCreateWithImageInRect support
  ui/cocoa: Remove compatibility ifdefs for OSX 10.4
  ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
  ui/cocoa: Declare that QemuCocoaAppController implements
    NSApplicationDelegate
  ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
  ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants

 ui/cocoa.m | 87 ++++++++++++++++++++++++++------------------------------------
 1 file changed, 37 insertions(+), 50 deletions(-)

-- 
2.2.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
@ 2015-05-10 22:19 ` Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4 Peter Maydell
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

The code that tries to test at both compiletime and runtime
for whether CGImageCreateWithImageInRect is supported provokes
a compile warning on OSX 10.3:

ui/cocoa.m:378:13: warning: comparison of function 'CGImageCreateWithImageInRect'
      equal to a null pointer is always false[-Wtautological-pointer-compare]
        if (CGImageCreateWithImageInRect == NULL) { // test if "CGImageCreateWithImageInRect" is
supported on host at runtime
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~

The simplest way to deal with this is just to drop this code,
since we don't in practice support OSX 10.4 anyway. (10.5 was
released in 2007 and is the last PPC version, so is the earliest
we really need to continue to support at all.)

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

diff --git a/ui/cocoa.m b/ui/cocoa.m
index d1d29bc..6e69952 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -374,40 +374,30 @@ QemuCocoaView *cocoaView;
             0, //interpolate
             kCGRenderingIntentDefault //intent
         );
-// test if host supports "CGImageCreateWithImageInRect" at compile time
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
-        if (CGImageCreateWithImageInRect == NULL) { // test if "CGImageCreateWithImageInRect" is supported on host at runtime
-#endif
-            // compatibility drawing code (draws everything) (OS X < 10.4)
-            CGContextDrawImage (viewContextRef, CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), imageRef);
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
-        } else {
-            // selective drawing code (draws only dirty rectangles) (OS X >= 10.4)
-            const NSRect *rectList;
+        // selective drawing code (draws only dirty rectangles) (OS X >= 10.4)
+        const NSRect *rectList;
 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
-            NSInteger rectCount;
+        NSInteger rectCount;
 #else
-            int rectCount;
+        int rectCount;
 #endif
-            int i;
-            CGImageRef clipImageRef;
-            CGRect clipRect;
-
-            [self getRectsBeingDrawn:&rectList count:&rectCount];
-            for (i = 0; i < rectCount; i++) {
-                clipRect.origin.x = rectList[i].origin.x / cdx;
-                clipRect.origin.y = (float)screen.height - (rectList[i].origin.y + rectList[i].size.height) / cdy;
-                clipRect.size.width = rectList[i].size.width / cdx;
-                clipRect.size.height = rectList[i].size.height / cdy;
-                clipImageRef = CGImageCreateWithImageInRect(
-                    imageRef,
-                    clipRect
-                );
-                CGContextDrawImage (viewContextRef, cgrect(rectList[i]), clipImageRef);
-                CGImageRelease (clipImageRef);
-            }
+        int i;
+        CGImageRef clipImageRef;
+        CGRect clipRect;
+
+        [self getRectsBeingDrawn:&rectList count:&rectCount];
+        for (i = 0; i < rectCount; i++) {
+            clipRect.origin.x = rectList[i].origin.x / cdx;
+            clipRect.origin.y = (float)screen.height - (rectList[i].origin.y + rectList[i].size.height) / cdy;
+            clipRect.size.width = rectList[i].size.width / cdx;
+            clipRect.size.height = rectList[i].size.height / cdy;
+            clipImageRef = CGImageCreateWithImageInRect(
+                                                        imageRef,
+                                                        clipRect
+                                                        );
+            CGContextDrawImage (viewContextRef, cgrect(rectList[i]), clipImageRef);
+            CGImageRelease (clipImageRef);
         }
-#endif
         CGImageRelease (imageRef);
     }
 }
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support Peter Maydell
@ 2015-05-10 22:19 ` Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 3/6] ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int Peter Maydell
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

Remove compatibility ifdefs that work around OSX 10.4 not providing
various typedefs and functions.

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

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6e69952..f6c5fb4 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -30,9 +30,6 @@
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
-#ifndef MAC_OS_X_VERSION_10_4
-#define MAC_OS_X_VERSION_10_4 1040
-#endif
 #ifndef MAC_OS_X_VERSION_10_5
 #define MAC_OS_X_VERSION_10_5 1050
 #endif
@@ -376,11 +373,7 @@ QemuCocoaView *cocoaView;
         );
         // selective drawing code (draws only dirty rectangles) (OS X >= 10.4)
         const NSRect *rectList;
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
         NSInteger rectCount;
-#else
-        int rectCount;
-#endif
         int i;
         CGImageRef clipImageRef;
         CGRect clipRect;
@@ -490,33 +483,25 @@ QemuCocoaView *cocoaView;
         isFullscreen = FALSE;
         [self ungrabMouse];
         [self setContentDimensions];
-// test if host supports "exitFullScreenModeWithOptions" at compile time
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
         if ([NSView respondsToSelector:@selector(exitFullScreenModeWithOptions:)]) { // test if "exitFullScreenModeWithOptions" is supported on host at runtime
             [self exitFullScreenModeWithOptions:nil];
         } else {
-#endif
             [fullScreenWindow close];
             [normalWindow setContentView: self];
             [normalWindow makeKeyAndOrderFront: self];
             [NSMenu setMenuBarVisible:YES];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
         }
-#endif
     } else { // switch from desktop to fullscreen
         isFullscreen = TRUE;
         [normalWindow orderOut: nil]; /* Hide the window */
         [self grabMouse];
         [self setContentDimensions];
-// test if host supports "enterFullScreenMode:withOptions" at compile time
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
         if ([NSView respondsToSelector:@selector(enterFullScreenMode:withOptions:)]) { // test if "enterFullScreenMode:withOptions" is supported on host at runtime
             [self enterFullScreenMode:[NSScreen mainScreen] withOptions:[NSDictionary dictionaryWithObjectsAndKeys:
                 [NSNumber numberWithBool:NO], NSFullScreenModeAllScreens,
                 [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], kCGDisplayModeIsStretched, nil], NSFullScreenModeSetting,
                  nil]];
         } else {
-#endif
             [NSMenu setMenuBarVisible:NO];
             fullScreenWindow = [[NSWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame]
                 styleMask:NSBorderlessWindowMask
@@ -528,9 +513,7 @@ QemuCocoaView *cocoaView;
             [self setFrame:NSMakeRect(cx, cy, cw, ch)];
             [[fullScreenWindow contentView] addSubview: self];
             [fullScreenWindow makeKeyAndOrderFront:self];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
         }
-#endif
     }
 }
 
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 3/6] ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4 Peter Maydell
@ 2015-05-10 22:19 ` Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate Peter Maydell
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

The type for openPanelDidEnd's returnCode argument should be NSInteger,
not int. This only matters for the OSX 10.5 code path where we pass
the method directly to an OSX function to call.

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

diff --git a/ui/cocoa.m b/ui/cocoa.m
index f6c5fb4..563ea47 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -787,7 +787,7 @@ QemuCocoaView *cocoaView;
 {
 }
 - (void)startEmulationWithArgc:(int)argc argv:(char**)argv;
-- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
+- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
 - (void)doToggleFullScreen:(id)sender;
 - (void)toggleFullScreen:(id)sender;
 - (void)showQEMUDoc:(id)sender;
@@ -890,7 +890,7 @@ QemuCocoaView *cocoaView;
     exit(status);
 }
 
-- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
+- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
 {
     COCOA_DEBUG("QemuCocoaAppController: openPanelDidEnd\n");
 
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
                   ` (2 preceding siblings ...)
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 3/6] ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int Peter Maydell
@ 2015-05-10 22:19 ` Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 5/6] ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up Peter Maydell
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

Our class QemuCocoaAppController implements the NSApplicationDelegate
interface, and we pass an object of this class to [NSApp setDelegate].
However, we weren't declaring in the class definition that we implemented
this interface; in OSX 10.10 this provokes the following (slighly
misleading) warning:
ui/cocoa.m:1031:24: warning: sending 'QemuCocoaAppController *' to parameter of
      incompatible type 'id<NSFileManagerDelegate>'
    [NSApp setDelegate:appController];
                       ^~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47:
note: passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5,
2_0);
                                              ^

Annoyingly, this interface wasn't formally defined until OSX 10.6, so we
have to surround the relevant part of the @interface line with an ifdef.

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

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 563ea47..e7b29e0 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -784,6 +784,9 @@ QemuCocoaView *cocoaView;
  ------------------------------------------------------
 */
 @interface QemuCocoaAppController : NSObject
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+                                             <NSApplicationDelegate>
+#endif
 {
 }
 - (void)startEmulationWithArgc:(int)argc argv:(char**)argv;
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 5/6] ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
                   ` (3 preceding siblings ...)
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate Peter Maydell
@ 2015-05-10 22:19 ` Peter Maydell
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 6/6] ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants Peter Maydell
  2015-05-11 23:45 ` [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Programmingkid
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

Starting in OSX 10.10, NSWindow useOptimizedDrawing is deprecated, so
don't use it there.

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

diff --git a/ui/cocoa.m b/ui/cocoa.m
index e7b29e0..fade0fd 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -36,6 +36,9 @@
 #ifndef MAC_OS_X_VERSION_10_6
 #define MAC_OS_X_VERSION_10_6 1060
 #endif
+#ifndef MAC_OS_X_VERSION_10_10
+#define MAC_OS_X_VERSION_10_10 101000
+#endif
 
 
 //#define DEBUG
@@ -824,7 +827,9 @@ QemuCocoaView *cocoaView;
         [normalWindow setAcceptsMouseMovedEvents:YES];
         [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]];
         [normalWindow setContentView:cocoaView];
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
         [normalWindow useOptimizedDrawing:YES];
+#endif
         [normalWindow makeKeyAndOrderFront:self];
         [normalWindow center];
         stretch_video = false;
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Qemu-devel] [PATCH 6/6] ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
                   ` (4 preceding siblings ...)
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 5/6] ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up Peter Maydell
@ 2015-05-10 22:19 ` Peter Maydell
  2015-05-11 23:45 ` [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Programmingkid
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-10 22:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, Alexander Graf, patches

In OSX 10.10, the NSOKButton and NSCancelButton constants are deprecated
and provoke compiler warnings. Avoid them by using the
NSFileHandlingPanelCancelButton and NSFileHandlingPanelOKButton constants
instead. These are the documented correct constants for the 10.6-and-up
beginSheetModalForWindow API we use. We also use the same method for
the pre-10.6 compatibility code path, but conveniently the constant
values are the same and the constant names have been present since 10.0.
Preferring the constant names that match the non-legacy API makes more
sense anyway.

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

diff --git a/ui/cocoa.m b/ui/cocoa.m
index fade0fd..0a51fbc 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -902,9 +902,15 @@ QemuCocoaView *cocoaView;
 {
     COCOA_DEBUG("QemuCocoaAppController: openPanelDidEnd\n");
 
-    if(returnCode == NSCancelButton) {
+    /* The NSFileHandlingPanelOKButton/NSFileHandlingPanelCancelButton values for
+     * returnCode strictly only apply for the 10.6-and-up beginSheetModalForWindow
+     * API. For the legacy pre-10.6 beginSheetForDirectory API they are NSOKButton
+     * and NSCancelButton. However conveniently the values are the same.
+     * We use the non-legacy names because the others are deprecated in OSX 10.10.
+     */
+    if (returnCode == NSFileHandlingPanelCancelButton) {
         exit(0);
-    } else if(returnCode == NSOKButton) {
+    } else if (returnCode == NSFileHandlingPanelOKButton) {
         char *img = (char*)[ [ [ sheet URL ] path ] cStringUsingEncoding:NSASCIIStringEncoding];
 
         char **argv = g_new(char *, 4);
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support)
  2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
                   ` (5 preceding siblings ...)
  2015-05-10 22:19 ` [Qemu-devel] [PATCH 6/6] ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants Peter Maydell
@ 2015-05-11 23:45 ` Programmingkid
  2015-05-12  6:54   ` Peter Maydell
  6 siblings, 1 reply; 9+ messages in thread
From: Programmingkid @ 2015-05-11 23:45 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alexander Graf, Andreas Färber, qemu-devel, patches


On May 10, 2015, at 6:19 PM, Peter Maydell wrote:

> This patchset fixes a number of new compile warnings when building
> on OSX10.10 which were not present on 10.9, which are mostly fixes
> to avoid deprecated APIs.
> 
> I've chosen to implement some of them by simply dropping the
> backward-compatibility support for OSX 10.4. This is basically
> a pragmatic decision since I don't think we can support ancient
> versions forever, especially when I don't actually have a system
> to test compiling them on. (Last time I tried building QEMU on 10.4
> it was an insane pain because you had to start by building all
> the dependencies and a new compiler too.) I would not be terribly
> surprised somebody told me we'd already accidentally broken 10.4
> compilation, in fact.
> 
> 10.5 is the last PPC OSX release so it seems like a reasonable
> minimum-version requirement (though I don't have a 10.5 setup
> either, so am reliant on people telling me if it breaks.)
> 
> This patchset sits on top of my current cocoa.next branch which
> you can find here:
> https://git.linaro.org/people/peter.maydell/qemu-arm.git cocoa.next
> 
> If you have a pre-10.10 system and can test that this patchset
> doesn't break compilation that would be nice. (I checked the
> Apple documentation's notes about when functions and constants
> were first defined, so it should be OK...)
> 
> Peter Maydell (6):
>  ui/cocoa: Drop tests for CGImageCreateWithImageInRect support
>  ui/cocoa: Remove compatibility ifdefs for OSX 10.4
>  ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
>  ui/cocoa: Declare that QemuCocoaAppController implements
>    NSApplicationDelegate
>  ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
>  ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants
> 
> ui/cocoa.m | 87 ++++++++++++++++++++++++++------------------------------------
> 1 file changed, 37 insertions(+), 50 deletions(-)
> 
> -- 
> 2.2.1
> 

I hate seeing support for older operating system end. The only thing you appear to be seeing are warnings. Are they really so bad? It might be simpler to just disable warnings. In the end I guess there isn't someone out there who is using QEMU on Mac OS 10.4 or earlier. 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support)
  2015-05-11 23:45 ` [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Programmingkid
@ 2015-05-12  6:54   ` Peter Maydell
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-05-12  6:54 UTC (permalink / raw)
  To: Programmingkid
  Cc: Alexander Graf, Andreas Färber, QEMU Developers,
	Patch Tracking

On 12 May 2015 at 00:45, Programmingkid <programmingkidx@gmail.com> wrote:
> On May 10, 2015, at 6:19 PM, Peter Maydell wrote:
>> I've chosen to implement some of them by simply dropping the
>> backward-compatibility support for OSX 10.4. This is basically
>> a pragmatic decision since I don't think we can support ancient
>> versions forever, especially when I don't actually have a system
>> to test compiling them on. (Last time I tried building QEMU on 10.4
>> it was an insane pain because you had to start by building all
>> the dependencies and a new compiler too.) I would not be terribly
>> surprised somebody told me we'd already accidentally broken 10.4
>> compilation, in fact.
>>
>> 10.5 is the last PPC OSX release so it seems like a reasonable
>> minimum-version requirement (though I don't have a 10.5 setup
>> either, so am reliant on people telling me if it breaks.)

> I hate seeing support for older operating system end. The only
> thing you appear to be seeing are warnings. Are they really so
> bad? It might be simpler to just disable warnings. In the end I
> guess there isn't someone out there who is using QEMU on Mac OS 10.4
> or earlier.

Well, we've already in some sense dropped 10.4 support, because
10.4 doesn't have rez/setfile, so it won't build with the icon
patch applied. I wouldn't mind continuing to support 10.4 if
we had at least one person who had 10.4 and had an actual use
for 10.4 support and regularly built on 10.4 and told us if we
broke things. But we don't, so all that we're really doing with
these ifdefs is making our code more complicated and harder to
maintain. 10.5 came out in 2007...

-- PMM

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-05-12  6:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-10 22:19 [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Peter Maydell
2015-05-10 22:19 ` [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support Peter Maydell
2015-05-10 22:19 ` [Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4 Peter Maydell
2015-05-10 22:19 ` [Qemu-devel] [PATCH 3/6] ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int Peter Maydell
2015-05-10 22:19 ` [Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate Peter Maydell
2015-05-10 22:19 ` [Qemu-devel] [PATCH 5/6] ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up Peter Maydell
2015-05-10 22:19 ` [Qemu-devel] [PATCH 6/6] ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants Peter Maydell
2015-05-11 23:45 ` [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support) Programmingkid
2015-05-12  6:54   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).