bswap: Fix build on FreeBSD 10.0
RFC 1/1 bswap: Fix build on FreeBSD 10.0
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.
---
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(+)
include/qemu/bswap.h +2 -0
@@ -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>
Signature · 1 line
1.8.4.5
Quoted 9 lines · Andreas Färber
FreeBSD 10.0-RELEASE has
bswap16()etc. macros defined insys/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 <[email protected]>---
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~
Quoted 6 lines · Richard Henderson
Quoted 5 lines · Andreas Färber
FreeBSD 10.0-RELEASE has
bswap16()etc. macros defined insys/endian.h, which leads to a conflict with our static inline definitions.Force using the system version of the macros.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Andreas Färber <[email protected]>---
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