pkgsrc/audio/openal/patches/patch-aa
obache 70c2d11081 define _NETBSD_SOURCE for fixing build problem on NetBSD 3.1.
XXX: define here. if pass this definision to configure, try to build solaris
XXX: backend, raise another build problem.
2007-04-06 15:47:29 +00:00

44 lines
1 KiB
Text

$NetBSD: patch-aa,v 1.3 2007/04/06 15:47:29 obache Exp $
--- src/backends/alc_backend_bsd.c.orig 2006-01-05 15:11:20.000000000 +0000
+++ src/backends/alc_backend_bsd.c
@@ -9,15 +9,27 @@
*/
#include "al_siteconfig.h"
+#ifdef __NetBSD__
+#define _NETBSD_SOURCE
+#endif
+
#include <AL/al.h>
+#include <AL/alext.h>
#include <assert.h>
#include <fcntl.h>
+#if defined(__FreeBSD__)
+#include <machine/soundcard.h>
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
+#include <soundcard.h>
+#else
#include <sys/soundcard.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <sys/select.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -210,7 +222,11 @@ void release_native(void *handle) {
handle_fd = *(int *) handle;
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+ if(ioctl(handle_fd, SNDCTL_DSP_RESET, NULL) < 0) {
+#else
if(ioctl(handle_fd, SNDCTL_DSP_RESET) < 0) {
+#endif
#ifdef DEBUG_MAXIMUS
fprintf(stderr, "Couldn't reset dsp\n");
#endif