Skip to content

Commit c6caad1

Browse files
committed
Fix compilation if sys/sysctl.h is not present
Glibc 2.32 removes sys/sysctl.h as it is no longer needed. This commit uses __has_include to check whether the header exists and only includes it if it does.
1 parent 20dde1a commit c6caad1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libavutil/cpu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@
3939
#include <sys/param.h>
4040
#endif
4141
#include <sys/types.h>
42+
43+
#if __has_include(<sys/sysctl.h>)
4244
#include <sys/sysctl.h>
4345
#endif
46+
#endif
4447
#if HAVE_UNISTD_H
4548
#include <unistd.h>
4649
#endif

0 commit comments

Comments
 (0)