[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 6/6] qemu/bswap: Use compiler __builtin_bswap() on NetBSD
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 6/6] qemu/bswap: Use compiler __builtin_bswap() on NetBSD |
Date: |
Wed, 11 Jan 2023 17:31:47 +0100 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Since commit efc6c070aca ("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 1360677cfe3ca8f945fa1de77823df21a77e4500
("makes NetBSD use the native bswap functions").
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/qemu/bswap.h | 11 -----------
meson.build | 4 ----
2 files changed, 15 deletions(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 32d5cdec27..3cbe52246b 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -1,27 +1,16 @@
#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)
{
diff --git a/meson.build b/meson.build
index 697059d2c8..f2663cfc32 100644
--- a/meson.build
+++ b/meson.build
@@ -2023,10 +2023,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',
--
2.38.1
- [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap(), Philippe Mathieu-Daudé, 2023/01/11
- [PATCH v3 1/6] qemu/bswap: Replace bswapXX() by compiler __builtin_bswap(), Philippe Mathieu-Daudé, 2023/01/11
- [PATCH v3 2/6] qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap(), Philippe Mathieu-Daudé, 2023/01/11
- [PATCH v3 3/6] qemu/bswap: Remove <byteswap.h> dependency, Philippe Mathieu-Daudé, 2023/01/11
- [PATCH v3 4/6] qemu/bswap: Use compiler __builtin_bswap() on Haiku, Philippe Mathieu-Daudé, 2023/01/11
- [PATCH v3 5/6] qemu/bswap: Use compiler __builtin_bswap() on FreeBSD, Philippe Mathieu-Daudé, 2023/01/11
- [PATCH v3 6/6] qemu/bswap: Use compiler __builtin_bswap() on NetBSD,
Philippe Mathieu-Daudé <=
- Re: [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap(), Richard Henderson, 2023/01/12
- Re: [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap(), Thomas Huth, 2023/01/26