From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5886] Attached patch makes NetBSD use the native bswap functions
Date: Fri, 05 Dec 2008 17:54:09 +0000 [thread overview]
Message-ID: <E1L8esT-0007CF-O4@cvs.savannah.gnu.org> (raw)
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 <Christoph.Egger@amd.com>
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 <inttypes.h>
+#ifdef HAVE_MACHINE_BSWAP_H
+#include <sys/endian.h>
+#include <sys/types.h>
+#include <machine/bswap.h>
+#else
+
#ifdef HAVE_BYTESWAP_H
#include <byteswap.h>
#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 <sys/endian.h>
+#include <sys/types.h>
+#include <machine/bswap.h>
+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
reply other threads:[~2008-12-05 17:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1L8esT-0007CF-O4@cvs.savannah.gnu.org \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).