From 3ee18ffc28be480b1c8bfb072f73a991734b3c25 Mon Sep 17 00:00:00 2001 From: Rick Yorgason Date: Sun, 1 Aug 2021 17:30:06 -0700 Subject: [PATCH] Added extra check for HAVE_STRNDUP in Win32 Mingw Meson build Mingw on Windows defines the strndup function, but it's not actually usable because string.h doesn't exist. See details on the Meson bug here: https://github.com/mesonbuild/meson/issues/3672 Note that although Meson marked this bug as "fixed", it's only fixed in the case where you're using `prefix : '#include '`. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5ddf7868b..f3ff3b4b8 100644 --- a/meson.build +++ b/meson.build @@ -115,7 +115,6 @@ check_funcs = [ 'funlockfile', 'getline', 'link', - 'strndup', 'fork', 'waitpid', 'raise', @@ -820,6 +819,8 @@ foreach name : check_funcs endif endforeach +conf.set('HAVE_STRNDUP', cc.has_function('strndup', prefix : '#include ')) + pthread_c_args = [] pthread_link_args = []