openbsd-ports/multimedia/aom/patches/patch-aom_ports_arm_cpudetect_c
2022-03-11 19:39:15 +00:00

29 lines
743 B
Plaintext

Allow ARM CPU runtime detection code to build on OpenBSD.
Index: aom_ports/arm_cpudetect.c
--- aom_ports/arm_cpudetect.c.orig
+++ aom_ports/arm_cpudetect.c
@@ -143,7 +143,21 @@ int aom_arm_cpu_caps(void) {
}
return flags & mask;
}
-#else /* end __linux__ */
+#elif defined(__OpenBSD__) /* end __linux__ */
+int aom_arm_cpu_caps(void) {
+ int flags;
+ int mask;
+ if (!arm_cpu_env_flags(&flags)) {
+ return flags;
+ }
+ mask = arm_cpu_env_mask();
+#if HAVE_NEON
+ flags |= HAS_NEON;
+#endif /* HAVE_NEON */
+ return flags & mask;
+}
+
+#else /* end __OpenBSD__ */
#error \
"Runtime CPU detection selected, but no CPU detection method " \
"available for your platform. Rerun cmake with -DCONFIG_RUNTIME_CPU_DETECT=0."