From patchwork Thu Feb 18 18:05:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8353371 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 483C5C0553 for ; Thu, 18 Feb 2016 18:24:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEAF620375 for ; Thu, 18 Feb 2016 18:24:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07642202E9 for ; Thu, 18 Feb 2016 18:24:33 +0000 (UTC) Received: from localhost ([::1]:44167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTFg-0007iO-7i for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Feb 2016 13:24:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTFM-0007c6-KZ for qemu-devel@nongnu.org; Thu, 18 Feb 2016 13:24:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWTFL-00070h-Ay for qemu-devel@nongnu.org; Thu, 18 Feb 2016 13:24:12 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:38439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTFL-0006yz-3V for qemu-devel@nongnu.org; Thu, 18 Feb 2016 13:24:11 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.84) (envelope-from ) id 1aWSxC-000200-2c; Thu, 18 Feb 2016 18:05:26 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 18 Feb 2016 18:05:19 +0000 Message-Id: <1455818725-7647-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455818725-7647-1-git-send-email-peter.maydell@linaro.org> References: <1455818725-7647-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::1 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH 2/8] osdep.h: Define macros for the benefit of C++ before C++11 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For C++ before C++11, requires definition of the macros __STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS in order to enable definition of various macros by the header file. Define these in osdep.h, so that we get the right header file definitions whether osdep.h is being used by plain C, C++11 or older C++. In particular libvixl's header files depend on this and won't compile if osdep.h is included before them otherwise. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake --- include/qemu/osdep.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index cc055c9..c1b413d 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -28,6 +28,20 @@ #include "config-host.h" #include "qemu/compiler.h" +/* Older versions of C++ don't get definitions of various macros from + * stdlib.h unless we define these macros before first inclusion of + * that system header. + */ +#ifndef __STDC_CONSTANT_MACROS +#define __STDC_CONSTANT_MACROS +#endif +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif + /* The following block of code temporarily renames the daemon() function so the * compiler does not see the warning associated with it in stdlib.h on OSX */