diff --git a/meson.build b/meson.build index 4d0cf1714f2..dab44ad8057 100644 --- a/meson.build +++ b/meson.build @@ -1400,11 +1400,11 @@ endforeach functions_to_detect = { 'strtof': '', 'mkostemp': '', - 'memfd_create': '', + 'memfd_create': '#include ', 'random_r': '', 'flock': '', 'strtok_r': '', - 'getrandom': '', + 'getrandom': '#include ', 'qsort_s': '', 'posix_fallocate': '', 'secure_getenv': '', @@ -1412,7 +1412,7 @@ functions_to_detect = { } foreach f, prefix: functions_to_detect - if cc.has_function(f, prefix: prefix) + if cc.has_function(f, args: pre_args, prefix: prefix) pre_args += '-DHAVE_@0@'.format(f.to_upper()) endif endforeach