aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2025-04-24 13:50:14 +0900
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-04-25 17:09:58 +0200
commita5b30be534538dc6e44a68ce9734e45dd08f52ec (patch)
tree2caf99c46ebd93cbb2403212adaaba3189c1ddac
parent797150d69d2edba8b1bd4a7d8c7ba2df1219c503 (diff)
downloadqemu-a5b30be534538dc6e44a68ce9734e45dd08f52ec.zip
qemu-a5b30be534538dc6e44a68ce9734e45dd08f52ec.tar.gz
qemu-a5b30be534538dc6e44a68ce9734e45dd08f52ec.tar.bz2
meson: Use osdep_prefix for strchrnul()
macOS SDK may have the symbol of strchrnul(), but it is actually available only on macOS 15.4 or later and that fact is codified in string.h. Include the header file using osdep_prefix to check if the function is available on the deployment target. Cc: qemu-stable@nongnu.org Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250424-buildsys-v1-4-97655e3b25d7@daynix.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
-rw-r--r--meson.build3
1 files changed, 2 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index d93dbde..c736a6f 100644
--- a/meson.build
+++ b/meson.build
@@ -2193,6 +2193,7 @@ osdep_prefix = '''
#include <stddef.h>
#include <sys/types.h>
+ #include <string.h>
#include <limits.h>
/* Put unistd.h before time.h as that triggers localtime_r/gmtime_r
* function availability on recentish Mingw-w64 platforms. */
@@ -2657,7 +2658,7 @@ config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
config_host_data.set('HAVE_GLIB_WITH_ALIGNED_ALLOC', glib_has_aligned_alloc)
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
-config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
+config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul', prefix: osdep_prefix))
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
if rbd.found()
config_host_data.set('HAVE_RBD_NAMESPACE_EXISTS',