mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-04 05:30:31 -07:00
osdep: Avoid using Clang-specific __builtin_available()
Remove the Clang specific __builtin_available() to allow building
with GCC, otherwise we get:
include/qemu/osdep.h: In function 'qemu_thread_jit_write':
include/qemu/osdep.h:787:9: warning: implicit declaration of function '__builtin_available'; did you mean '__builtin_scalbl'? [-Wimplicit-function-declaration]
787 | if (__builtin_available(macOS 11.0, *)) {
| ^~~~~~~~~~~~~~~~~~~
| __builtin_scalbl
include/qemu/osdep.h:787:9: warning: nested extern declaration of '__builtin_available' [-Wnested-externs]
include/qemu/osdep.h:787:29: error: 'macOS' undeclared (first use in this function)
787 | if (__builtin_available(macOS 11.0, *)) {
| ^~~~~
include/qemu/osdep.h:787:29: note: each undeclared identifier is reported only once for each function it appears in
include/qemu/osdep.h:787:34: error: expected ')' before numeric constant
787 | if (__builtin_available(macOS 11.0, *)) {
| ~ ^~~~~
| )
Beside, on macOS Catalina we get 2254 times:
include/qemu/osdep.h:780:5: warning: 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer [-Wunguarded-availability-new]
pthread_jit_write_protect_np(true);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix by using a stricker toolchain version low range, replacing
MAC_OS_X_VERSION_MAX_ALLOWED by MAC_OS_X_VERSION_MIN_REQUIRED.
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
8b46d7e2dc
commit
98f5ebfd21
1 changed files with 3 additions and 7 deletions
|
|
@ -624,19 +624,15 @@ size_t qemu_get_host_physmem(void);
|
|||
* for the current thread.
|
||||
*/
|
||||
#if defined(MAC_OS_VERSION_11_0) && \
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0
|
||||
static inline void qemu_thread_jit_execute(void)
|
||||
{
|
||||
if (__builtin_available(macOS 11.0, *)) {
|
||||
pthread_jit_write_protect_np(true);
|
||||
}
|
||||
pthread_jit_write_protect_np(true);
|
||||
}
|
||||
|
||||
static inline void qemu_thread_jit_write(void)
|
||||
{
|
||||
if (__builtin_available(macOS 11.0, *)) {
|
||||
pthread_jit_write_protect_np(false);
|
||||
}
|
||||
pthread_jit_write_protect_np(false);
|
||||
}
|
||||
#else
|
||||
static inline void qemu_thread_jit_write(void) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue