From 6e93a2ce5f7c41731d0f07ac6a3638d9f981d707 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 29 Mar 2024 14:00:01 -0500 Subject: [PATCH] meson: Fix false positive detection of mempcpy on macOS The has_function check incorrectly detects mempcpy on macOS. This function is not available on macOS and should not be detected. Likely, this has to do with Meson's detection of compiler built-ins. Using a specific prefix and defining _GNU_SOURCE fixes the detection. Signed-off-by: Jordan Williams (cherry picked from commit 2c5a42b3cbf278461a12872ce7a944ad396d47b5) --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f46356ac6..77f6dd845 100644 --- a/meson.build +++ b/meson.build @@ -565,7 +565,6 @@ funcs = ''' llistxattr llseek newlocale - mempcpy mkostemp move_mount mount_setattr @@ -630,6 +629,9 @@ foreach func: funcs conf.set('HAVE_' + func.to_upper(), have ? 1 : false) endforeach +have_mempcpy = cc.has_function('mempcpy', prefix: '#include ', args: '-D_GNU_SOURCE') +conf.set('HAVE_MEMPCPY', have_mempcpy ? 1 : false) + have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1] conf.set('AGETTY_RELOAD', have ? 1 : false) if not have -- 2.47.3