]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Use has_type instead of sizeof to detect cpu_set_t type
authorJordan Williams <jordan@jwillikers.com>
Mon, 22 Apr 2024 14:28:04 +0000 (09:28 -0500)
committerJordan Williams <jordan@jwillikers.com>
Wed, 24 Apr 2024 20:30:30 +0000 (15:30 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build

index 67181ca05f621fd737cfcf740ce13b1c74e3cdb9..cddeb98372cc0cf10b24e05fdb823481a81a5765 100644 (file)
@@ -460,8 +460,7 @@ endforeach
 
 have = cc.has_header('sched.h')
 conf.set10('HAVE_DECL_CPU_ALLOC', have)
-# We get -1 if the size cannot be determined
-have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include <sched.h>') > 0
+have_cpu_set_t = cc.has_type('cpu_set_t', args : '-D_GNU_SOURCE', prefix : '#include <sched.h>')
 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
 
 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')