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 <string.h>'`.
This commit is contained in:
Rick Yorgason 2021-08-01 17:30:06 -07:00
parent d88dd1794e
commit 3ee18ffc28

View file

@ -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 <string.h>'))
pthread_c_args = []
pthread_link_args = []