freebsd-ports/audio/flac/files/patch-src_libFLAC_cpu.c
Christian Weisgerber e8c58c6b92 Update to FLAC 1.1.2. Notable changes:
* better Ogg FLAC support
* speedups
* several new options to flac and metaflac
* several API additions
* streaming support in the XMMS plugin
* bugfixes
2005-03-16 14:49:23 +00:00

32 lines
743 B
C

$FreeBSD$
--- src/libFLAC/cpu.c.orig
+++ src/libFLAC/cpu.c
@@ -37,6 +37,11 @@
#include <config.h>
#endif
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
#if defined FLAC__CPU_PPC
#if !defined FLAC__NO_ASM
#if defined FLAC__SYS_DARWIN
@@ -95,6 +100,14 @@
#ifndef FLAC__SSE_OS
info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false;
+#elif defined(__FreeBSD__)
+ /* on FreeBSD we can double-check via sysctl whether the OS supports SSE */
+ {
+ int sse;
+ size_t len = sizeof(sse);
+ if (sysctlbyname("hw.instruction_sse", &sse, &len, NULL, 0) || !sse)
+ info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false;
+ }
#endif
#ifdef FLAC__USE_3DNOW