diff --git a/meson.build b/meson.build index b2fdbae61..edbb5f119 100644 --- a/meson.build +++ b/meson.build @@ -468,33 +468,13 @@ foreach f : functions endif endforeach -if cc.get_id() == 'gcc' or cc.get_id() == 'clang' - no_builtin_args = cc.get_supported_arguments(['-fno-builtin']) -else - no_builtin_args = [] -endif - -# Check that stpcpy() is not a builtin -if cc.links('''#include - int main (int argc, char ** argv) { - char p[10]; - return stpcpy (p, argv[0]) != NULL; - } - ''', - args : no_builtin_args, - name : 'stpcpy() is not a builtin') +# Check that stpcpy() is usable; must use header +if cc.has_function('stpcpy', prefix : '#include ') glib_conf.set('HAVE_STPCPY', 1) endif -# Check that posix_memalign() is not a builtin -if cc.links('''#include - int main (int argc, char ** argv) { - void *p; - return posix_memalign (&p, 16, argc); - } - ''', - args : no_builtin_args, - name : 'posix_memalign() is not a builtin') +# Check that posix_memalign() is usable; must use header +if cc.has_function('posix_memalign', prefix : '#include ') glib_conf.set('HAVE_POSIX_MEMALIGN', 1) endif