Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | Index: alsa-oss-1.0.28/alsa/stdioemu.c |
| 2 | =================================================================== |
| 3 | --- alsa-oss-1.0.28.orig/alsa/stdioemu.c |
| 4 | +++ alsa-oss-1.0.28/alsa/stdioemu.c |
| 5 | @@ -37,7 +37,9 @@ |
| 6 | #endif |
| 7 | |
| 8 | #include <stdio.h> |
| 9 | +#ifdef HAVE_LIBIO_H |
| 10 | #include <libio.h> |
| 11 | +#endif |
| 12 | |
| 13 | struct fd_cookie { |
| 14 | int fd; |
| 15 | @@ -99,7 +101,11 @@ static FILE *fake_fopen(const char *path |
| 16 | |
| 17 | if (open_mode && fdc->fd > 0) { |
| 18 | result = fopencookie (fdc,"w", fns); |
| 19 | +#ifdef HAVE_FILENO |
| 20 | result->_fileno = fdc->fd; /* ugly patchy slimy kludgy hack */ |
| 21 | +#else |
| 22 | + result->__filedes = fdc->fd; |
| 23 | +#endif |
| 24 | } |
| 25 | return result; |
| 26 | } |
| 27 | Index: alsa-oss-1.0.28/configure.ac |
| 28 | =================================================================== |
| 29 | --- alsa-oss-1.0.28.orig/configure.ac |
| 30 | +++ alsa-oss-1.0.28/configure.ac |
| 31 | @@ -35,6 +35,12 @@ if test "$with_aoss" = "yes"; then |
| 32 | LIBS="$OLD_LIBS" |
| 33 | fi |
| 34 | |
| 35 | +AC_CHECK_HEADERS_ONCE([libio.h]) |
| 36 | + |
| 37 | +AC_CHECK_MEMBER([struct _IO_FILE._fileno], |
| 38 | + [AC_DEFINE([HAVE_FILENO], [1],[Define if _fileno exists.])], |
| 39 | + [],[]) |
| 40 | + |
| 41 | AC_OUTPUT(Makefile alsa/Makefile alsa/aoss alsa/aoss.old \ |
| 42 | oss-redir/Makefile test/Makefile \ |
| 43 | alsa/testaoss test/testaoss) |