Update of /cvsroot/alsa/alsa-oss/alsa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28242
Modified Files: alsa-oss-emul.h alsa-oss.c mixer.c pcm.c Added Files: alsa-local.h Log Message: Cleanup - the libaoss.so shouldn't depend on libasound.so --- NEW FILE: alsa-local.h --- #include "alsa-oss-emul.h" #if 1 #define DEBUG_POLL #define DEBUG_SELECT #ifdef NEW_MACRO_VARARGS #define DEBUG(...) do { if (alsa_oss_debug) fprintf(stderr, __VA_ARGS__); } while (0) #else /* !NEW_MACRO_VARARGS */ #define DEBUG(args...) do { if (alsa_oss_debug) fprintf(stderr, ##args); } while (0) #endif #else #ifdef NEW_MACRO_VARARGS #define DEBUG(...) #else /* !NEW_MACRO_VARARGS */ #define DEBUG(args...) #endif #endif extern int alsa_oss_debug; extern snd_output_t *alsa_oss_debug_out; Index: alsa-oss-emul.h =================================================================== RCS file: /cvsroot/alsa/alsa-oss/alsa/alsa-oss-emul.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- alsa-oss-emul.h 18 Feb 2004 20:17:05 -0000 1.2 +++ alsa-oss-emul.h 26 Feb 2004 10:52:40 -0000 1.3 @@ -24,22 +24,6 @@ #define NEW_MACRO_VARARGS #endif -#if 1 -#define DEBUG_POLL -#define DEBUG_SELECT -#ifdef NEW_MACRO_VARARGS -#define DEBUG(...) do { if (alsa_oss_debug) fprintf(stderr, __VA_ARGS__); } while (0) -#else /* !NEW_MACRO_VARARGS */ -#define DEBUG(args...) do { if (alsa_oss_debug) fprintf(stderr, ##args); } while (0) -#endif -#else -#ifdef NEW_MACRO_VARARGS -#define DEBUG(...) -#else /* !NEW_MACRO_VARARGS */ -#define DEBUG(args...) -#endif -#endif - #define OSS_MAJOR 14 #define OSS_DEVICE_MIXER 0 #define OSS_DEVICE_SEQUENCER 1 @@ -78,7 +62,4 @@ extern int lib_oss_mixer_close(int fd); extern int lib_oss_mixer_ioctl(int fd, unsigned long int request, ...); -extern int alsa_oss_debug; -extern snd_output_t *alsa_oss_debug_out; - #endif /* __ALSA_OSS_EMUL_H */ Index: alsa-oss.c =================================================================== RCS file: /cvsroot/alsa/alsa-oss/alsa/alsa-oss.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- alsa-oss.c 19 Feb 2004 16:02:20 -0000 1.7 +++ alsa-oss.c 26 Feb 2004 10:52:40 -0000 1.8 @@ -30,17 +30,38 @@ #include <sys/mman.h> #include <stdarg.h> #include <unistd.h> +#include <fcntl.h> #include <dlfcn.h> #include <stdio.h> -#include <fcntl.h> +#include <stdlib.h> +#include <string.h> #include <limits.h> #include <errno.h> #include <assert.h> -#include <linux/soundcard.h> -#include <alsa/asoundlib.h> #include "alsa-oss-emul.h" +#ifndef ATTRIBUTE_UNUSED +/** do not print warning (gcc) when function parameter is not used */ +#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +#if 1 +#define DEBUG_POLL +#define DEBUG_SELECT +#ifdef NEW_MACRO_VARARGS +#define DEBUG(...) do { if (oss_wrapper_debug) fprintf(stderr, __VA_ARGS__); } while (0) +#else /* !NEW_MACRO_VARARGS */ +#define DEBUG(args...) do { if (oss_wrapper_debug) fprintf(stderr, ##args); } while (0) +#endif +#else +#ifdef NEW_MACRO_VARARGS +#define DEBUG(...) +#else /* !NEW_MACRO_VARARGS */ +#define DEBUG(args...) +#endif +#endif + int (*_select)(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); int (*_poll)(struct pollfd *ufds, unsigned int nfds, int timeout); int (*_open)(const char *file, int oflag, ...); @@ -76,6 +97,7 @@ void *mmap_area; } fd_t; +static int oss_wrapper_debug = 0; static int open_max; static int poll_fds_add = 0; static fd_t **fds; @@ -407,7 +429,7 @@ if (direct) return _poll(pfds, nfds, timeout); #ifdef DEBUG_POLL - if (alsa_oss_debug) { + if (oss_wrapper_debug) { fprintf(stderr, "Orig enter "); dump_poll(pfds, nfds, timeout); fprintf(stderr, "Changed enter "); @@ -450,7 +472,7 @@ count1++; } #ifdef DEBUG_POLL - if (alsa_oss_debug) { + if (oss_wrapper_debug) { fprintf(stderr, "Changed exit "); dump_poll(pfds1, nfds1, timeout); fprintf(stderr, "Orig exit "); @@ -529,7 +551,7 @@ if (direct) return _select(nfds, rfds, wfds, efds, timeout); #ifdef DEBUG_SELECT - if (alsa_oss_debug) { + if (oss_wrapper_debug) { fprintf(stderr, "Orig enter "); dump_select(nfds, rfds, wfds, efds, timeout); fprintf(stderr, "Changed enter "); @@ -598,7 +620,7 @@ count1++; } #ifdef DEBUG_SELECT - if (alsa_oss_debug) { + if (oss_wrapper_debug) { fprintf(stderr, "Changed exit "); dump_select(nfds1, rfds1, wfds1, efds1, timeout); fprintf(stderr, "Orig exit "); @@ -676,7 +698,7 @@ return; s = getenv("ALSA_OSS_DEBUG"); if (s) - alsa_oss_debug = 1; + oss_wrapper_debug = 1; open_max = sysconf(_SC_OPEN_MAX); if (open_max < 0) exit(1); Index: mixer.c =================================================================== RCS file: /cvsroot/alsa/alsa-oss/alsa/mixer.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mixer.c 11 Feb 2004 19:09:03 -0000 1.2 +++ mixer.c 26 Feb 2004 10:52:40 -0000 1.3 @@ -38,7 +38,7 @@ #include <linux/soundcard.h> #include <alsa/asoundlib.h> -#include "alsa-oss-emul.h" +#include "alsa-local.h" typedef struct _oss_mixer { int fileno; Index: pcm.c =================================================================== RCS file: /cvsroot/alsa/alsa-oss/alsa/pcm.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- pcm.c 21 Feb 2004 20:39:54 -0000 1.7 +++ pcm.c 26 Feb 2004 10:52:40 -0000 1.8 @@ -38,7 +38,7 @@ #include <linux/soundcard.h> #include <alsa/asoundlib.h> -#include "alsa-oss-emul.h" +#include "alsa-local.h" int alsa_oss_debug = 0; snd_output_t *alsa_oss_debug_out = NULL; ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog