meson: fix detection of strndup() on windows

master
Ariadne Conill 2020-05-24 14:53:37 -06:00
parent 4fb7683c3e
commit 82d57184e7
2 changed files with 6 additions and 5 deletions

1
NEWS
View File

@ -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

View File

@ -28,14 +28,14 @@ foreach h : check_headers
endforeach
check_functions = [
['HAVE_CYGWIN_CONV_PATH', 'cygwin_conv_path', '#include<sys/cygwin.h>'],
['HAVE_STRLCAT', 'strlcat', '#include<string.h>'],
['HAVE_STRLCPY', 'strlcpy', '#include<string.h>'],
['HAVE_STRNDUP', 'strndup', '#include<string.h>'],
['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