Skip to content

Commit 7bff88a

Browse files
akihikodakiMichael Tokarev
authored andcommitted
meson: Use has_header_symbol() to check getcpu()
The use of gnu_source_prefix in the detection of getcpu() was ineffective because the header file that declares getcpu() when _GNU_SOURCE is defined was not included. Pass sched.h to has_header_symbol() so that the existence of the declaration will be properly checked. Cc: [email protected] Signed-off-by: Akihiko Odaki <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> (cherry picked from commit 563cd69) Signed-off-by: Michael Tokarev <[email protected]>
1 parent e60bbda commit 7bff88a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2635,7 +2635,6 @@ config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime'))
26352635
config_host_data.set('CONFIG_DUP3', cc.has_function('dup3'))
26362636
config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate'))
26372637
config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
2638-
config_host_data.set('CONFIG_GETCPU', cc.has_function('getcpu', prefix: gnu_source_prefix))
26392638
config_host_data.set('CONFIG_SCHED_GETCPU', cc.has_function('sched_getcpu', prefix: '#include <sched.h>'))
26402639
# Note that we need to specify prefix: here to avoid incorrectly
26412640
# thinking that Windows has posix_memalign()
@@ -2713,6 +2712,8 @@ config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE',
27132712
config_host_data.set('CONFIG_FIEMAP',
27142713
cc.has_header('linux/fiemap.h') and
27152714
cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP'))
2715+
config_host_data.set('CONFIG_GETCPU',
2716+
cc.has_header_symbol('sched.h', 'getcpu', prefix: gnu_source_prefix))
27162717
config_host_data.set('CONFIG_GETRANDOM',
27172718
cc.has_function('getrandom') and
27182719
cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK'))

0 commit comments

Comments
 (0)