qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC for-2.0] bswap: Fix build on FreeBSD 10.0
@ 2014-04-02 14:06 Andreas Färber
  2014-04-02 18:52 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Färber @ 2014-04-02 14:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Andreas Färber, rth

FreeBSD 10.0-RELEASE has bswap16() etc. macros defined in sys/endian.h,
which leads to a conflict with our static inline definitions.

Force using the system version of the macros.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 On 9.0-RELEASE I did not have this issue, so unsure if some version check
 is needed or some more generic configure check?

 include/qemu/bswap.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 0cb7c05..0f9c6cf 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -11,6 +11,8 @@
 # include <sys/endian.h>
 # include <sys/types.h>
 # include <machine/bswap.h>
+#elif defined(__FreeBSD__)
+# include <sys/endian.h>
 #elif defined(CONFIG_BYTESWAP_H)
 # include <byteswap.h>
 
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [RFC for-2.0] bswap: Fix build on FreeBSD 10.0
  2014-04-02 14:06 [Qemu-devel] [RFC for-2.0] bswap: Fix build on FreeBSD 10.0 Andreas Färber
@ 2014-04-02 18:52 ` Richard Henderson
  2014-04-02 20:57   ` Ed Maste
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2014-04-02 18:52 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel; +Cc: peter.maydell

On 04/02/2014 07:06 AM, Andreas Färber wrote:
> FreeBSD 10.0-RELEASE has bswap16() etc. macros defined in sys/endian.h,
> which leads to a conflict with our static inline definitions.
> 
> Force using the system version of the macros.
> 
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> ---
>  On 9.0-RELEASE I did not have this issue, so unsure if some version check
>  is needed or some more generic configure check?

Looks plausible, but I have no bsd specific experience.
I'd say if it works for both 9.0 and 10.0, let it go in as is.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [RFC for-2.0] bswap: Fix build on FreeBSD 10.0
  2014-04-02 18:52 ` Richard Henderson
@ 2014-04-02 20:57   ` Ed Maste
  0 siblings, 0 replies; 3+ messages in thread
From: Ed Maste @ 2014-04-02 20:57 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Peter Maydell, Andreas Färber, qemu-devel

On 2 April 2014 14:52, Richard Henderson <rth@twiddle.net> wrote:
> On 04/02/2014 07:06 AM, Andreas Färber wrote:
>> FreeBSD 10.0-RELEASE has bswap16() etc. macros defined in sys/endian.h,
>> which leads to a conflict with our static inline definitions.
>>
>> Force using the system version of the macros.
>>
>> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
>> ---
>>  On 9.0-RELEASE I did not have this issue, so unsure if some version check
>>  is needed or some more generic configure check?
>
> Looks plausible, but I have no bsd specific experience.
> I'd say if it works for both 9.0 and 10.0, let it go in as is.

This change builds fine for me on FreeBSD 9.

-Ed

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-02 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02 14:06 [Qemu-devel] [RFC for-2.0] bswap: Fix build on FreeBSD 10.0 Andreas Färber
2014-04-02 18:52 ` Richard Henderson
2014-04-02 20:57   ` Ed Maste

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).