From 82d57184e77f790f398483e01b0b2581bd120550 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 24 May 2020 14:53:37 -0600 Subject: [PATCH] meson: fix detection of strndup() on windows --- NEWS | 1 + meson.build | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index ad28500..79a233c 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Changes from 1.6.3 to 1.7.0: - Return the default personality if loading a cross-compile personality file failed. - Do not complain about newlines when validating package versions. + - Properly detect strndup() on Windows when building with Meson. * Enhancements: - A new --shared option and WantDefaultStatic cross-compile diff --git a/meson.build b/meson.build index 6df0ccf..8ef596f 100644 --- a/meson.build +++ b/meson.build @@ -28,14 +28,14 @@ foreach h : check_headers endforeach check_functions = [ - ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', '#include'], - ['HAVE_STRLCAT', 'strlcat', '#include'], - ['HAVE_STRLCPY', 'strlcpy', '#include'], - ['HAVE_STRNDUP', 'strndup', '#include'], + ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', 'sys/cygwin.h'], + ['HAVE_STRLCAT', 'strlcat', 'string.h'], + ['HAVE_STRLCPY', 'strlcpy', 'string.h'], + ['HAVE_STRNDUP', 'strndup', 'string.h'], ] foreach f : check_functions - if cc.has_function(f.get(1), prefix : f.get(2)) + if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) cdata.set(f.get(0), 1) endif endforeach