]> Git Repo - qemu.git/commit - include/qemu/osdep.h
osdep: Avoid using Clang-specific __builtin_available()
authorPhilippe Mathieu-Daudé <[email protected]>
Tue, 15 Feb 2022 11:34:58 +0000 (12:34 +0100)
committerPhilippe Mathieu-Daudé <[email protected]>
Tue, 15 Mar 2022 12:36:33 +0000 (13:36 +0100)
commit98f5ebfd21b144fb70b02df3e419dec0ee2a52a8
tree209d6d8dba2f9bd0dc9316aa2926902b0b18bc55
parent8b46d7e2dc8ec4b3515e43bc28ee77d9afab8b23
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 <[email protected]>
Tested-by: Akihiko Odaki <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
include/qemu/osdep.h
This page took 0.022444 seconds and 4 git commands to generate.