[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/11] Cocoa: Fix compilation on Mac OS X v10.4 and
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 05/11] Cocoa: Fix compilation on Mac OS X v10.4 and earlier |
Date: |
Sun, 13 Dec 2009 03:55:35 +0100 |
NSView's enterFullScreenMode:withOptions: and
exitFullScreenModeWithOptions: are available on v10.5
and later only. Undefined methods raise warnings and
undefined constants result in errors.
Reported by Ryan Schmidt.
While at it, avoid a warning on v10.3.9,
where MAC_OS_X_VERSION_10_4 is not defined.
Spotted by John Arbuckle.
Fix associated comments.
Signed-off-by: Andreas Färber <address@hidden>
Cc: John Arbuckle <address@hidden>
Cc: Ryan Schmidt <address@hidden>
Cc: Mike Kronenberg <address@hidden>
---
cocoa.m | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/cocoa.m b/cocoa.m
index 0a95c77..6f8b674 100644
--- a/cocoa.m
+++ b/cocoa.m
@@ -28,6 +28,9 @@
#include "console.h"
#include "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
@@ -331,7 +334,7 @@ static int cocoa_keycode_to_qemu(int keycode)
0, //interpolate
kCGRenderingIntentDefault //intent
);
-// test if host support "CGImageCreateWithImageInRect" at compiletime
+// 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
@@ -428,8 +431,8 @@ static int cocoa_keycode_to_qemu(int keycode)
isFullscreen = FALSE;
[self ungrabMouse];
[self setContentDimensions];
-// test if host support "enterFullScreenMode:withOptions" at compiletime
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
+// 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 {
@@ -438,15 +441,15 @@ static int cocoa_keycode_to_qemu(int keycode)
[normalWindow setContentView: self];
[normalWindow makeKeyAndOrderFront: self];
[NSMenu setMenuBarVisible:YES];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
}
#endif
} else { // switch from desktop to fullscreen
isFullscreen = TRUE;
[self grabMouse];
[self setContentDimensions];
-// test if host support "enterFullScreenMode:withOptions" at compiletime
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
+// 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,
@@ -462,7 +465,7 @@ static int cocoa_keycode_to_qemu(int keycode)
[fullScreenWindow setHasShadow:NO];
[fullScreenWindow setContentView:self];
[fullScreenWindow makeKeyAndOrderFront:self];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
}
#endif
}
--
1.6.5.3
- [Qemu-devel] Cocoa: ppc64 host support and various improvements, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 01/11] Cocoa: ppc64 host support, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 02/11] Cocoa: Silence warning for cocoa_keycode_to_qemu, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 03/11] Cocoa: Silence warning on Big Endian host, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 04/11] Cocoa: Silence type warning, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 05/11] Cocoa: Fix compilation on Mac OS X v10.4 and earlier,
Andreas Färber <=
- [Qemu-devel] [PATCH 06/11] Cocoa: Mark the View as opaque, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 07/11] Cocoa: Redraw the View asynchronously, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 08/11] Cocoa: Don't unconditionally show the window, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 10/11] Cocoa: Suppress window resize animation, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 11/11] Cocoa: Use optimized drawing for the window, Andreas Färber, 2009/12/12
- Re: [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed, Juha.Riihimaki, 2009/12/14
- [Qemu-devel] [PATCH v2 09/11] Cocoa: Shutdown when window is closed, Andreas Färber, 2009/12/14
- Re: [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed, Andreas Färber, 2009/12/14