From patchwork Tue Oct 31 20:43:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 10035397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E6B1602B9 for ; Tue, 31 Oct 2017 20:48:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6041228578 for ; Tue, 31 Oct 2017 20:48:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5151928479; Tue, 31 Oct 2017 20:48:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id D1B7328479 for ; Tue, 31 Oct 2017 20:48:48 +0000 (UTC) Received: from localhost ([::1]:47323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9dSp-0003pa-PE for patchwork-qemu-devel@patchwork.kernel.org; Tue, 31 Oct 2017 16:48:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9dOA-00013v-RO for qemu-devel@nongnu.org; Tue, 31 Oct 2017 16:43:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9dO7-0004Ea-OP for qemu-devel@nongnu.org; Tue, 31 Oct 2017 16:43:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e9dO7-0004EA-FJ for qemu-devel@nongnu.org; Tue, 31 Oct 2017 16:43:55 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9VKf8r4087449 for ; Tue, 31 Oct 2017 16:43:53 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dy04ugwvy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 31 Oct 2017 16:43:52 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Oct 2017 14:43:52 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 31 Oct 2017 14:43:50 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9VKhnaS51511524; Tue, 31 Oct 2017 13:43:49 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9917CC6037; Tue, 31 Oct 2017 14:43:49 -0600 (MDT) Received: from localhost.localdomain (unknown [9.85.136.158]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 04EE6C603C; Tue, 31 Oct 2017 14:43:47 -0600 (MDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Date: Tue, 31 Oct 2017 18:43:30 -0200 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171031204330.14803-1-danielhb@linux.vnet.ibm.com> References: <20171031204330.14803-1-danielhb@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17103120-0008-0000-0000-000008CBB885 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007988; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00939263; UDB=6.00473526; IPR=6.00719524; BA=6.00005666; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017811; XFM=3.00000015; UTC=2017-10-31 20:43:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17103120-0009-0000-0000-000044950A20 Message-Id: <20171031204330.14803-5-danielhb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-31_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710310252 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v2 4/4] tests/rtas-test.c: fix Apple endian.h include 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: lvivier@redhat.com, qemu-ppc@nongnu.org, mdroth@linux.vnet.ibm.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Recent rtas-test.c changes added a call to 'be32toh', a function from the header 'endian.h' in Linux. This caused QEMU Travis build to break because be32toh is undefined in Mac OS (even using the machine/endian.h header). This patch makes a conditional code to include the proper header file if we're compiling in an __APPLE__ env. Signed-off-by: Daniel Henrique Barboza --- tests/rtas-test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/rtas-test.c b/tests/rtas-test.c index b3538bf878..511980ad17 100644 --- a/tests/rtas-test.c +++ b/tests/rtas-test.c @@ -5,6 +5,17 @@ #include "libqos/libqos-spapr.h" #include "libqos/rtas.h" +#if defined(__APPLE__) +# include + +# define be32toh(x) OSSwapBigToHostInt32(x) +# define __BYTE_ORDER BYTE_ORDER +# define __BIG_ENDIAN BIG_ENDIAN +# define __LITTLE_ENDIAN LITTLE_ENDIAN +#else +# include +#endif + #define EVENT_MASK_EPOW (1 << 30) #define EVENT_LOG_LEN 2048