]> 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>
Thu, 25 Apr 2024 12:30:55 +0000 (07:30 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit fa3bce7e0025fb921a8d05ac26288e687cd1bec5)

meson.build

index e4eca8ff7a3034a5a89338472002475991639e6c..0e4e82b4fe519918ddd25c2c78e1d568303864fb 100644 (file)
@@ -451,8 +451,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')