meson: use cc.check_header instead of open coding
authorDylan Baker <dylan@pnwbakers.com>
Wed, 19 Jan 2022 19:10:58 +0000 (11:10 -0800)
committerDylan Baker <dylan@pnwbakers.com>
Thu, 20 Jan 2022 18:08:23 +0000 (10:08 -0800)
Signed-off-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
meson.build

index 5c4618a..83bf29c 100644 (file)
@@ -205,8 +205,7 @@ else
 endif
 
 foreach header : ['sys/select.h', 'alloca.h']
-  config.set10('HAVE_' + header.underscorify().to_upper(),
-    cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
+  config.set10('HAVE_' + header.underscorify().to_upper(), cc.check_header(header))
 endforeach
 
 if (cc.has_header_symbol('sys/sysmacros.h', 'major') and