diff --git a/meson.build b/meson.build
index d9abf3777f6d4fb5e323e3c4ed6fd53baaa516ff..73d2bc55e5190c5c4402d8c5d43eef92557b36d5 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,7 @@ check_functions = [
 ]
 conf = configuration_data()
 foreach check_function : check_functions
-  if cc.compiles('''
+  have_it = cc.compiles('''
     #include <sys/types.h>
     #include <unistd.h>
     #include <stdio.h>
@@ -30,8 +30,7 @@ foreach check_function : check_functions
     args : '-D_GNU_SOURCE',
     name : check_function + '() is declared',
   )
-    conf.set('HAVE_DECL_' + check_function.underscorify().to_upper(), 1)
-  endif
+  conf.set10('HAVE_DECL_' + check_function.underscorify().to_upper(), have_it)
 endforeach
 config_h = configure_file(
   output : 'config.h',