From 474b4fbfe408d2626800f48c905b36c1c0f50b82 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 15 Aug 2022 11:11:54 -0400 Subject: [PATCH] fix: ifdef linux specific cpu count compat Expand the '#ifdef __linux__' block in src/compat-cpu.h to all static inline functions related to sysfs since they are only useful on Linux and fail to build on some non-Linux platforms. This issue was reported on QNX. Thanks to Elad Lahav for reporting this issue. Change-Id: I17c88a9a2fb5b9be6cf5325234a18ff40788cd09 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/compat-smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compat-smp.h b/src/compat-smp.h index 7240d2f..31fa979 100644 --- a/src/compat-smp.h +++ b/src/compat-smp.h @@ -36,6 +36,7 @@ static inline int get_num_possible_cpus_sysconf(void) } #endif +#ifdef __linux__ /* * Get the highest CPU id from sysfs. * @@ -235,7 +236,6 @@ error: return -1; } -#ifdef __linux__ /* * On Linux try sysfs first and fallback to sysconf. */ -- 2.34.1