From patchwork Sun May 27 16:32:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 161555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 48339B6F9D for ; Mon, 28 May 2012 02:32:18 +1000 (EST) Received: from localhost ([::1]:53239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYgO7-0007Zp-Oq for incoming@patchwork.ozlabs.org; Sun, 27 May 2012 12:32:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYgO0-0007ZB-3z for qemu-devel@nongnu.org; Sun, 27 May 2012 12:32:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYgNy-0003F9-Dd for qemu-devel@nongnu.org; Sun, 27 May 2012 12:32:07 -0400 Received: from mout.web.de ([212.227.15.4]:58813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYgNy-0003Ex-4Z for qemu-devel@nongnu.org; Sun, 27 May 2012 12:32:06 -0400 Received: from af.local ([62.157.78.131]) by smtp.web.de (mrweb002) with ESMTPA (Nemesis) id 0MOB3E-1SeA2J3Lr2-005W0I; Sun, 27 May 2012 18:32:04 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 27 May 2012 18:32:03 +0200 Message-Id: <1338136323-53160-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.5.3 MIME-Version: 1.0 X-Provags-ID: V02:K0:9q4wWkRcsLejt1Ttlie2cngFgOhQMPU3Thrkv566ctu ggKNnGcVT6oxzmKGWVv2mn6FV3xpZuqaj8tERUaSNu13ytfulx 6/M8zsaIlT1nyBsUpCMGBXZm5CNWtVhk/GSR8L3cKSrtuoPctt 3GDYRU4Of9lNFtptcNa1kUm+pxUslhawM0LPKQI9wz2ok+ZU79 1XfInEeUpVIaUeah11SCw== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.15.4 Cc: Jan Kiszka , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH for-1.1?] slirp: Avoid statements without effect on Big Endian host 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Darwin has HTON*/NTOH* macros that on BE simply return the argument. This is incompatible with SLIRP's use of these macros as a statement. Special-case Darwin in the HOST_WORDS_BIGENDIAN code path to redefine these macros as no-op statement to avoid tons of compiler warnings. Signed-off-by: Andreas Färber --- slirp/ip.h | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index 88c903f..6e98b1d 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -34,17 +34,28 @@ #define _IP_H_ #ifdef HOST_WORDS_BIGENDIAN -# ifndef NTOHL -# define NTOHL(d) -# endif -# ifndef NTOHS -# define NTOHS(d) -# endif -# ifndef HTONL -# define HTONL(d) -# endif -# ifndef HTONS -# define HTONS(d) +# if defined(__APPLE__) +# undef NTOHL +# undef NTOHS +# undef HTONL +# undef HTONS +# define NTOHL(d) do { } while (0) +# define NTOHS(d) do { } while (0) +# define HTONL(d) do { } while (0) +# define HTONS(d) do { } while (0) +# else +# ifndef NTOHL +# define NTOHL(d) +# endif +# ifndef NTOHS +# define NTOHS(d) +# endif +# ifndef HTONL +# define HTONL(d) +# endif +# ifndef HTONS +# define HTONS(d) +# endif # endif #else # ifndef NTOHL