From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8esZ-0002Gf-0G for qemu-devel@nongnu.org; Fri, 05 Dec 2008 12:54:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8esY-0002GG-BL for qemu-devel@nongnu.org; Fri, 05 Dec 2008 12:54:14 -0500 Received: from [199.232.76.173] (port=37082 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8esY-0002G1-17 for qemu-devel@nongnu.org; Fri, 05 Dec 2008 12:54:14 -0500 Received: from savannah.gnu.org ([199.232.41.3]:39588 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L8esX-0001Mg-06 for qemu-devel@nongnu.org; Fri, 05 Dec 2008 12:54:13 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L8esU-0007CL-18 for qemu-devel@nongnu.org; Fri, 05 Dec 2008 17:54:10 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L8esT-0007CF-O4 for qemu-devel@nongnu.org; Fri, 05 Dec 2008 17:54:09 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Fri, 05 Dec 2008 17:54:09 +0000 Subject: [Qemu-devel] [5886] Attached patch makes NetBSD use the native bswap functions Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5886 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5886 Author: blueswir1 Date: 2008-12-05 17:54:09 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Attached patch makes NetBSD use the native bswap functions which compile. Signed-off-by: Christoph Egger Modified Paths: -------------- trunk/bswap.h trunk/configure Modified: trunk/bswap.h =================================================================== --- trunk/bswap.h 2008-12-05 17:53:21 UTC (rev 5885) +++ trunk/bswap.h 2008-12-05 17:54:09 UTC (rev 5886) @@ -5,6 +5,12 @@ #include +#ifdef HAVE_MACHINE_BSWAP_H +#include +#include +#include +#else + #ifdef HAVE_BYTESWAP_H #include #else @@ -58,6 +64,8 @@ return bswap_64(x); } +#endif /* ! HAVE_MACHINE_BSWAP_H */ + static inline void bswap16s(uint16_t *s) { *s = bswap16(*s); Modified: trunk/configure =================================================================== --- trunk/configure 2008-12-05 17:53:21 UTC (rev 5885) +++ trunk/configure 2008-12-05 17:54:09 UTC (rev 5886) @@ -1229,6 +1229,15 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then echo "#define HAVE_BYTESWAP_H 1" >> $config_h fi + cat > $TMPC << EOF +#include +#include +#include +int main(void) { return bswap32(0); } +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h + fi fi if [ "$openbsd" = "yes" ] ; then