Skip to content

Commit

Permalink
Fix compilation if sys/sysctl.h is not present
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrsnen committed Jun 19, 2023
1 parent 20dde1a commit c6caad1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavutil/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
#include <sys/param.h>
#endif
#include <sys/types.h>

#if __has_include(<sys/sysctl.h>)
#include <sys/sysctl.h>
#endif
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
Expand Down

0 comments on commit c6caad1

Please sign in to comment.