From: Jordan Williams Date: Mon, 22 Apr 2024 14:28:04 +0000 (-0500) Subject: meson: Use has_type instead of sizeof to detect cpu_set_t type X-Git-Tag: v2.40.1-rc1~9^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48ea38fdc06a06caaba157cba8dc853d7753bcce;p=thirdparty%2Futil-linux.git meson: Use has_type instead of sizeof to detect cpu_set_t type Signed-off-by: Jordan Williams (cherry picked from commit fa3bce7e0025fb921a8d05ac26288e687cd1bec5) --- diff --git a/meson.build b/meson.build index e4eca8ff7..0e4e82b4f 100644 --- a/meson.build +++ b/meson.build @@ -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 ') > 0 +have_cpu_set_t = cc.has_type('cpu_set_t', args : '-D_GNU_SOURCE', prefix : '#include ') conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false) have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')