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
|
$NetBSD: patch-aa,v 1.3 2011/09/04 04:37:55 dholland Exp $
--- softmixer.c.orig 2007-12-15 07:38:57.000000000 +0000
+++ softmixer.c
@@ -17,6 +17,10 @@
#include "config.h"
#endif
+#ifdef __NetBSD__
+#include <sys/param.h>
+#endif
+
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
@@ -35,6 +39,12 @@
#include "common.h"
#include "log.h"
+#if defined(__NetBSD__) && __NetBSD_Version__ < 599001500
+#define OLD_GETLINE
+int getline(FILE *, char *, size_t, const char **);
+#include "getline.c"
+#endif
+
#define swap_32bit_endianess(i32) \
( ((i32&0x000000FF)<<24) | ((i32&0x0000FF00)<<8)| \
((i32&0x00FF0000)>>8) | ((i32&0xFF000000)>>24) )
@@ -147,7 +157,11 @@ void softmixer_read_config()
int buffersize=-1, readbytes=-1;
int tmp;
+#ifdef OLD_GETLINE
+ while((readbytes=getline(cf, linebuffer, (size_t)buffersize, (void *)NULL) > -1))
+#else
while((readbytes=getline(&linebuffer, &buffersize, cf)>-1))
+#endif
{
if(
strncasecmp
|