diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-01-09 14:18:36 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-09 14:18:36 +0100 |
commit | fa3a89eeb72513797afbf953e3d687f2bd3d0eb8 (patch) | |
tree | eb316cf650e08710c1a4ad4d3d518d2d6278c15f | |
parent | 7f2ef7780bcb774d83f69b6ad52f914e0b5e0b58 (diff) | |
download | salsa-lib-fa3a89eeb72513797afbf953e3d687f2bd3d0eb8.tar.gz |
handle snd_config value in dummy conf routines
Handle snd_config value (set/reset) to fake some apps.
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/conf.h | 11 | ||||
-rw-r--r-- | src/global.h | 2 | ||||
-rw-r--r-- | src/recipe.h.in | 3 |
4 files changed, 22 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 805c51e..fff34d1 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,13 @@ else fi AC_SUBST(SALSA_HAS_ASYNC_SUPPORT) +if test "$sndconf" = "yes"; then + SALSA_HAS_DUMMY_CONF=1 +else + SALSA_HAS_DUMMY_CONF=0 +fi +AC_SUBST(SALSA_HAS_DUMMY_CONF) + AM_CONDITIONAL(LINK_LIBASOUND, test "$libasound" = "yes") AC_ARG_ENABLE(deprecated, @@ -53,6 +53,8 @@ int snd_config_save(snd_config_t *config, snd_output_t *out) static inline int snd_config_update(void) { + /* an invalid address, but just mark to be non-NULL */ + snd_config = (snd_config_t*)1; return 0; } @@ -69,7 +71,14 @@ int snd_config_update_free(snd_config_update_t *update) return 0; } -/* snd_config_update_free_global is defined in global.h */ +#if SALSA_HAS_DUMMY_CONF +static inline +int snd_config_update_free_global(void) +{ + snd_config = NULL; + return 0; +} +#endif static inline __SALSA_NOT_IMPLEMENTED int snd_config_search(snd_config_t *config, const char *key, diff --git a/src/global.h b/src/global.h index 30183b8..2b749a0 100644 --- a/src/global.h +++ b/src/global.h @@ -94,12 +94,14 @@ int snd_async_del_handler(snd_async_handler_t *handler) /* only for internal use */ int _snd_set_nonblock(int fd, int nonblock); +#if !SALSA_HAS_DUMMY_CONF /* the global function defined here */ static inline int snd_config_update_free_global(void) { return 0; } +#endif /* !SALSA_HAS_DUMMY_CONF */ /* * helper macros diff --git a/src/recipe.h.in b/src/recipe.h.in index bad6268..5b0bb2b 100644 --- a/src/recipe.h.in +++ b/src/recipe.h.in @@ -7,6 +7,9 @@ /* Build with async support */ #define SALSA_HAS_ASYNC_SUPPORT @SALSA_HAS_ASYNC_SUPPORT@ +/* Build with dummy conf support */ +#define SALSA_HAS_DUMMY_CONF @SALSA_HAS_DUMMY_CONF@ + /* Enable deprecated attribute for non-working functions */ #define SALSA_MARK_DEPRECATED @SALSA_MARK_DEPRECATED@ |