From: Michael Jeanson Date: Mon, 15 Aug 2022 15:11:54 +0000 (-0400) Subject: fix: ifdef linux specific cpu count compat X-Git-Tag: v0.12.4~7 X-Git-Url: http://git.lttng.org/?p=urcu.git;a=commitdiff_plain;h=474b4fbfe408d2626800f48c905b36c1c0f50b82 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 --- 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. */