summaryrefslogtreecommitdiff
path: root/audio/openal/patches/patch-aa
blob: 99d658529b05d5df78b650543e62a9fc6b6017c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$NetBSD: patch-aa,v 1.5 2013/12/15 20:33:47 asau Exp $

--- src/backends/alc_backend_bsd.c.orig	2006-01-05 15:11:20.000000000 +0000
+++ src/backends/alc_backend_bsd.c	2013-12-15 20:30:26.204504830 +0000
@@ -9,15 +9,31 @@
  */
 #include "al_siteconfig.h"
 
+#ifdef __NetBSD__
+#define _NETBSD_SOURCE
+#endif
+#ifdef __FreeBSD__
+#define __BSD_VISIBLE 1
+#endif
+
 #include <AL/al.h>
+#include <AL/alext.h>
 #include <assert.h>
 #include <fcntl.h>
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/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 +226,11 @@
 
 	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
@@ -385,7 +405,7 @@
 static void *grab_read_native(void)
 {
 	fprintf(stderr,"grab_read_native Not implemented! (%s:%d)\n",__FILE__,__LINE__);
-	return;
+	return NULL;
 }
 
 void *