--- meson.build +++ meson.build @@ -31,11 +31,11 @@ - ['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'], + ['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path(CCP_POSIX_TO_WIN_A, (void*)0, (void*)0, 0)', 'sys/cygwin.h'], + ['HAVE_STRLCAT', 'strlcat((void*)0, (void*)0, 0)', 'string.h'], + ['HAVE_STRLCPY', 'strlcpy((void*)0, (void*)0, 0)', 'string.h'], + ['HAVE_STRNDUP', 'strndup((void*)0, 0)', 'string.h'], ] foreach f : check_functions - if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) + if cc.links('#include <' + f.get(2) + '>\nint main() { ' + f.get(1) + ';}') cdata.set(f.get(0), 1) endif endforeach