summaryrefslogtreecommitdiff
path: root/packages/alsa/files/libio.patch
blob: a053e4c6047cb71154244b14bcfd66adaa31ea22 (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
Index: alsa-oss-1.0.15/alsa/stdioemu.c
===================================================================
--- alsa-oss-1.0.15.orig/alsa/stdioemu.c	2007-10-15 10:50:40.000000000 +0200
+++ alsa-oss-1.0.15/alsa/stdioemu.c	2008-07-21 22:17:06.303161438 +0200
@@ -37,7 +37,9 @@
 #endif
 
 #include <stdio.h>
+#ifdef HAVE_LIBIO_H
 #include <libio.h>
+#endif
 
 struct fd_cookie {
 	int fd;
@@ -99,7 +101,11 @@
 
 	if (open_mode && fdc->fd > 0) {
 		result = fopencookie (fdc,"w", fns);
+#ifdef HAVE_FILENO
 		result->_fileno = fdc->fd;		/* ugly patchy slimy kludgy hack */
+#else
+		result->__filedes = fdc->fd;
+#endif
 	}
 	return result;
 }
Index: alsa-oss-1.0.15/configure.in
===================================================================
--- alsa-oss-1.0.15.orig/configure.in	2007-10-15 10:50:40.000000000 +0200
+++ alsa-oss-1.0.15/configure.in	2008-07-21 22:16:11.719837298 +0200
@@ -33,6 +33,12 @@
   LIBS="$OLD_LIBS"
 fi
 
+AC_CHECK_HEADERS_ONCE([libio.h])
+
+AC_CHECK_MEMBER([struct _IO_FILE._fileno],
+		[AC_DEFINE([HAVE_FILENO], [1],[Define if _fileno exists.])],
+		[],[])
+
 AC_OUTPUT(Makefile alsa/Makefile alsa/aoss alsa/aoss.old \
 	  oss-redir/Makefile test/Makefile \
           alsa/testaoss test/testaoss)