[FFmpeg-devel] [PATCH] libavutil/mips: fix build if sys/auxv.h not present
Brilliantov Kirill Vladimirovich
brilliantov at inbox.ru
Mon Nov 15 14:23:42 EET 2021
---
configure | 1 +
libavutil/mips/cpu.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/configure b/configure
index 98113c95fd..18c93f2619 100755
--- a/configure
+++ b/configure
@@ -2148,6 +2148,7 @@ HEADERS_LIST="
valgrind_valgrind_h
windows_h
winsock2_h
+ sys_auxv_h
"
INTRINSICS_LIST="
diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c
index 59619d54de..854eabfc18 100644
--- a/libavutil/mips/cpu.c
+++ b/libavutil/mips/cpu.c
@@ -23,7 +23,9 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
+#if HAVE_SYS_AUXV_H
#include <sys/auxv.h>
+#endif
#include "asmdefs.h"
#include "libavutil/avstring.h"
#endif
@@ -34,7 +36,11 @@
static int cpucfg_available(void)
{
+#if HAVE_SYS_AUXV_H
return getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG;
+#else
+ return 0;
+#endif
}
/* Most toolchains have no CPUCFG support yet */
--
2.33.0
More information about the ffmpeg-devel
mailing list