diff options
author | Dylan Baker <[email protected]> | 2018-04-18 13:54:12 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-10-10 16:33:04 -0700 |
commit | 7ef85a0d92871b5ec555846bb091c246b5c4baf5 (patch) | |
tree | 8f37f27a85d0745f09eba9e37afa9c44ba2f3087 | |
parent | 597a063551fa413c611f5499a78ce59700fc0461 (diff) |
meson: Don't check for posix_memalign on windows
There's a mingw bug for this, it exports __builtin_posix_memalign but
not posix_memalign, so the check will succeed, but compiling will fail.
Reviewed-by: Eric Engestrom <[email protected]>
Acked-by: Kristian H. Kristensen <[email protected]>
-rw-r--r-- | meson.build | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 8c5ae52ba37..824765ec082 100644 --- a/meson.build +++ b/meson.build @@ -1145,7 +1145,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h' endif endforeach -foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r'] +foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r'] if cc.has_function(f) pre_args += '-DHAVE_@0@'.format(f.to_upper()) endif @@ -1158,6 +1158,16 @@ elif with_tools.contains('intel') error('Intel tools require the program_invocation_name variable') endif +# MinGW provides a __builtin_posix_memalign function, but not a posix_memalign. +# This means that this check will succeed, but then compilation will later +# fail. MSVC doesn't have this function at all, so only check for it on +# non-windows platforms. +if host_machine.system() != 'windows' + if cc.has_function('posix_memalign') + pre_args += '-DHAVE_POSIX_MEMALIGN' + endif +endif + # strtod locale support if cc.links(''' #define _GNU_SOURCE |