diff --git a/NEWS b/NEWS index 35b762de3..44252f4e6 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ ver 0.21.24 (not yet released) - simple: fix crash when mounting twice * fix unit test failure * fix build failure with Android NDK r21 +* work around Meson bug breaking the Windows build with GCC 10 ver 0.21.23 (2020/04/23) * protocol diff --git a/meson.build b/meson.build index 7c5dcac9f..ab28340a6 100644 --- a/meson.build +++ b/meson.build @@ -142,7 +142,13 @@ conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r')) conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r')) conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups')) conf.set('HAVE_FNMATCH', compiler.has_function('fnmatch')) -conf.set('HAVE_STRNDUP', compiler.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include ')) + +# Explicitly exclude Windows in this check because +# https://github.com/mesonbuild/meson/issues/3672 (reported in 2018, +# still not fixed in 2020) causes Meson to believe it exists, because +# __builtin_strndup() exists (but strndup() still cannot be used). +conf.set('HAVE_STRNDUP', not is_windows and compiler.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include ')) + conf.set('HAVE_STRCASESTR', compiler.has_function('strcasestr')) conf.set('HAVE_PRCTL', is_linux)