From 9d5d84a8350ec73f432d0522c274764ee37a9a50 Mon Sep 17 00:00:00 2001 From: Shogo Yamazaki Date: Wed, 7 Aug 2024 14:12:13 +0900 Subject: [PATCH] meson: fix false positive detection of `memfd_create` Add the arguments to `has_function` to properly detect availability of the function on SDK environments. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a99d1a48..7ce9d901 100644 --- a/meson.build +++ b/meson.build @@ -12,7 +12,8 @@ is_debug_build = get_option('buildtype').startswith('debug') cc = meson.get_compiler('c') -if cc.has_function('memfd_create') +if cc.has_function('memfd_create', + args: ['-D_GNU_SOURCE'], prefix: '#include ') add_project_arguments('-DMEMFD_CREATE', language: 'c') endif