[x264-devel] [Git][videolan/x264][master] 2 commits: ppc: Fix compilation on unknown OS
Anton Mitrofanov (@BugMaster)
gitlab at videolan.org
Sun Oct 1 15:09:48 UTC 2023
Anton Mitrofanov pushed to branch master at VideoLAN / x264
Commits:
31e19f92 by Anton Mitrofanov at 2023-10-01T17:28:26+03:00
ppc: Fix compilation on unknown OS
- - - - -
834c5c92 by Martin Husemann at 2023-10-01T17:35:48+03:00
ppc: Add x264_cpu_detect() for NetBSD/macppc
The altivec instruction set detection is very similar to FreeBSD
and OpenBSD, but uses slightly different sysctl selectors.
- - - - -
1 changed file:
- common/cpu.c
Changes:
=====================================
common/cpu.c
=====================================
@@ -305,7 +305,7 @@ uint32_t x264_cpu_detect( void )
#elif HAVE_ALTIVEC
-#if SYS_MACOSX || SYS_OPENBSD || SYS_FREEBSD
+#if SYS_MACOSX || SYS_OPENBSD || SYS_FREEBSD || SYS_NETBSD
uint32_t x264_cpu_detect( void )
{
@@ -320,6 +320,8 @@ uint32_t x264_cpu_detect( void )
size_t length = sizeof( has_altivec );
#if SYS_MACOSX || SYS_OPENBSD
int error = sysctl( selectors, 2, &has_altivec, &length, NULL, 0 );
+#elif SYS_NETBSD
+ int error = sysctlbyname( "machdep.altivec", &has_altivec, &length, NULL, 0 );
#else
int error = sysctlbyname( "hw.altivec", &has_altivec, &length, NULL, 0 );
#endif
@@ -358,6 +360,14 @@ uint32_t x264_cpu_detect( void )
return X264_CPU_ALTIVEC;
#endif
}
+
+#else
+
+uint32_t x264_cpu_detect( void )
+{
+ return 0;
+}
+
#endif
#elif HAVE_ARMV6
View it on GitLab: https://code.videolan.org/videolan/x264/-/compare/a8b68ebfaa68621b5ac8907610d3335971839d52...834c5c92db67bf34467915305544ad8c4fe97657
--
View it on GitLab: https://code.videolan.org/videolan/x264/-/compare/a8b68ebfaa68621b5ac8907610d3335971839d52...834c5c92db67bf34467915305544ad8c4fe97657
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the x264-devel
mailing list