From nobody Sat Nov 1 22:15:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527617817406404.94151949178706; Tue, 29 May 2018 11:16:57 -0700 (PDT) Received: from localhost ([::1]:34370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNjB2-0000Yi-MI for importer@patchew.org; Tue, 29 May 2018 14:16:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNj9j-0008OZ-1b for qemu-devel@nongnu.org; Tue, 29 May 2018 14:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNj9i-0001q2-2V for qemu-devel@nongnu.org; Tue, 29 May 2018 14:15:34 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:42252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNj9h-0001nf-Rq for qemu-devel@nongnu.org; Tue, 29 May 2018 14:15:34 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fNj9Z-0000OJ-78; Tue, 29 May 2018 19:15:25 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 19:15:23 +0100 Message-Id: <20180529181523.19185-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH v2] ui/cocoa: Suppress NSFileHandlingPanelOKButton deprecation warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Arbuckle , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and would rather you use NSModalResponseOK, which was introduced in OS 10.9. Use the recommended new constant name, with a backward compatibility define if we're building on an older OSX. Signed-off-by: Peter Maydell Reviewed-by: John Arbuckle --- v1->v2: define MAC_OS_X_VERSION_10_9 if the system headers don't; fixes compilation on versions before 10.9. --- ui/cocoa.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 110b393e4e..2991ed4f19 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -44,6 +44,9 @@ #ifndef MAC_OS_X_VERSION_10_6 #define MAC_OS_X_VERSION_10_6 1060 #endif +#ifndef MAC_OS_X_VERSION_10_9 +#define MAC_OS_X_VERSION_10_9 1090 +#endif #ifndef MAC_OS_X_VERSION_10_10 #define MAC_OS_X_VERSION_10_10 101000 #endif @@ -79,6 +82,13 @@ #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask #define NSWindowStyleMaskTitled NSTitledWindowMask #endif +/* 10.13 deprecates NSFileHandlingPanelOKButton in favour of + * NSModalResponseOK, which was introduced in 10.9. Define + * it for older versions. + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 +#define NSModalResponseOK NSFileHandlingPanelOKButton +#endif =20 //#define DEBUG =20 @@ -1218,7 +1228,7 @@ QemuCocoaView *cocoaView; [openPanel setCanChooseFiles: YES]; [openPanel setAllowsMultipleSelection: NO]; [openPanel setAllowedFileTypes: supportedImageFileTypes]; - if([openPanel runModal] =3D=3D NSFileHandlingPanelOKButton) { + if([openPanel runModal] =3D=3D NSModalResponseOK) { NSString * file =3D [[[openPanel URLs] objectAtIndex: 0] path]; if(file =3D=3D nil) { NSBeep(); --=20 2.17.0