Skip to content
Snippets Groups Projects
Commit ec6bf79d authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Thomas Huth
Browse files

qemu/bswap: Use compiler __builtin_bswap() on NetBSD


Since commit efc6c070 ("configure: Add a test for the minimum
compiler version") the minimum compiler version required for GCC
is 4.8, which supports __builtin_bswap().
Remove the NetBSD specific ifdef'ry.

This reverts commit 1360677c
("makes NetBSD use the native bswap functions").

Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20230111163147.71761-7-philmd@linaro.org>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent a97cfd56
No related branches found
No related tags found
No related merge requests found
#ifndef BSWAP_H
#define BSWAP_H
#ifdef CONFIG_MACHINE_BSWAP_H
# include <sys/endian.h>
# include <machine/bswap.h>
# else
#define BSWAP_FROM_FALLBACKS
#endif /* ! CONFIG_MACHINE_BSWAP_H */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef BSWAP_FROM_FALLBACKS
#undef bswap16
#define bswap16(_x) __builtin_bswap16(_x)
#undef bswap32
#define bswap32(_x) __builtin_bswap32(_x)
#undef bswap64
#define bswap64(_x) __builtin_bswap64(_x)
#endif
#undef BSWAP_FROM_FALLBACKS
static inline void bswap16s(uint16_t *s)
{
......
......@@ -2030,10 +2030,6 @@ config_host_data.set('CONFIG_INOTIFY',
cc.has_header_symbol('sys/inotify.h', 'inotify_init'))
config_host_data.set('CONFIG_INOTIFY1',
cc.has_header_symbol('sys/inotify.h', 'inotify_init1'))
config_host_data.set('CONFIG_MACHINE_BSWAP_H',
cc.has_header_symbol('machine/bswap.h', 'bswap32',
prefix: '''#include <sys/endian.h>
#include <sys/types.h>'''))
config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK',
cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK'))
config_host_data.set('CONFIG_RTNETLINK',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment