From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSef6-0007O1-33 for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSef1-0007L5-Gn for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:31 -0500 Received: from [199.232.76.173] (port=50110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSef1-0007L2-Cx for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:27 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:50457) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSef0-00054R-Qy for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:27 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 6 Jan 2010 23:47:11 +0100 Message-Id: <1262818037-926-6-git-send-email-andreas.faerber@web.de> In-Reply-To: <1262818037-926-5-git-send-email-andreas.faerber@web.de> References: <1262818037-926-1-git-send-email-andreas.faerber@web.de> <1262818037-926-2-git-send-email-andreas.faerber@web.de> <1262818037-926-3-git-send-email-andreas.faerber@web.de> <1262818037-926-4-git-send-email-andreas.faerber@web.de> <1262818037-926-5-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 RESEND 05/11] Cocoa: Fix compilation on Mac OS X v10.4 and earlier List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: John Arbuckle , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Ryan Schmidt , Mike Kronenberg 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=C3=A4rber Cc: John Arbuckle Cc: Ryan Schmidt Cc: Mike Kronenberg --- 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" =20 +#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 >=3D MAC_OS_X_VERSION_10_4) if (CGImageCreateWithImageInRect =3D=3D NULL) { // test if "CGIm= ageCreateWithImageInRect" is supported on host at runtime #endif @@ -428,8 +431,8 @@ static int cocoa_keycode_to_qemu(int keycode) isFullscreen =3D FALSE; [self ungrabMouse]; [self setContentDimensions]; -// test if host support "enterFullScreenMode:withOptions" at compiletime -#if (MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_4) +// test if host supports "exitFullScreenModeWithOptions" at compile time +#if (MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_5) if ([NSView respondsToSelector:@selector(exitFullScreenModeWithO= ptions:)]) { // test if "exitFullScreenModeWithOptions" is supported on h= ost 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 >=3D MAC_OS_X_VERSION_10_4) +#if (MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_5) } #endif } else { // switch from desktop to fullscreen isFullscreen =3D TRUE; [self grabMouse]; [self setContentDimensions]; -// test if host support "enterFullScreenMode:withOptions" at compiletime -#if (MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_4) +// test if host supports "enterFullScreenMode:withOptions" at compile ti= me +#if (MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_5) if ([NSView respondsToSelector:@selector(enterFullScreenMode:wit= hOptions:)]) { // 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 >=3D MAC_OS_X_VERSION_10_4) +#if (MAC_OS_X_VERSION_MAX_ALLOWED >=3D MAC_OS_X_VERSION_10_5) } #endif } --=20 1.6.5.3