From b9454c0fb3bb0e39b5226f5783b36272692c7e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20R=C3=A4s=C3=A4nen?= Date: Fri, 28 Apr 2023 14:25:43 +0300 Subject: [PATCH] Fix compilation if sys/sysctl.h is not present Glibc 2.32 removes sys/sysctl.h as it is no longer needed. This commit fixes the compilation with newer versions of Glibc by checking for sys/sysctl.h with has_include, which in turn is only used if it is supported. This should mean that this commit does not prevent any configuration that worked before from working. --- libavutil/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavutil/cpu.c b/libavutil/cpu.c index a22da0fa..d3bde0a0 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -39,8 +39,16 @@ #include #endif #include + + +#if __cplusplus >= 201703L +#if __has_include() #include #endif +#else +#include +#endif +#endif #if HAVE_UNISTD_H #include #endif