From 25e41cf1e87c6f8abb77e244284f958adbb53ec5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 10 Oct 2002 11:01:18 +0000 Subject: [PATCH] fixed the build without versioned symbols. the rc4 symbols are defined as __ prefix, which are aliased in pcm.h as well as the versioned symbol binary. --- include/alsa-symbols.h | 4 ---- src/pcm/pcm.c | 56 +++++++++++++++++++++++++++++++++++++------------- src/pcm/pcm_local.h | 6 +++--- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/include/alsa-symbols.h b/include/alsa-symbols.h index 9dab335f..e1a32e65 100644 --- a/include/alsa-symbols.h +++ b/include/alsa-symbols.h @@ -26,12 +26,8 @@ #define USE_VERSIONED_SYMBOLS #endif -#ifdef USE_VERSIONED_SYMBOLS #define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post #define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name) -#else -#define INTERNAL(Name) Name -#endif #define symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@" #version) diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index af2bb636..9ab753f0 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -6173,8 +6173,14 @@ void snd_pcm_unlink_appl_ptr(snd_pcm_t *pcm, snd_pcm_t *slave) symbol_version(__old_##name, name, what); #endif -#define __OLD_GET(name, val_type, ret_type) \ -ret_type __old_##name(const snd_pcm_hw_params_t *params) \ +#else + +#define OBSOLETE1(name, what, new) /**/ + +#endif /* USE_VERSIONED_SYMBOLS */ + +#define __P_OLD_GET(pfx, name, val_type, ret_type) \ +ret_type pfx##name(const snd_pcm_hw_params_t *params) \ { \ val_type val; \ if (INTERNAL(name)(params, &val) < 0) \ @@ -6182,8 +6188,8 @@ ret_type __old_##name(const snd_pcm_hw_params_t *params) \ return (ret_type)val; \ } -#define __OLD_GET1(name, val_type, ret_type) \ -ret_type __old_##name(const snd_pcm_hw_params_t *params, int *dir) \ +#define __P_OLD_GET1(pfx, name, val_type, ret_type) \ +ret_type pfx##name(const snd_pcm_hw_params_t *params, int *dir) \ { \ val_type val; \ if (INTERNAL(name)(params, &val, dir) < 0) \ @@ -6191,6 +6197,14 @@ ret_type __old_##name(const snd_pcm_hw_params_t *params, int *dir) \ return (ret_type)val; \ } +#ifdef USE_VERSIONED_SYMBOLS +#define __OLD_GET(name, val_type, ret_type) __P_OLD_GET(__old_, name, val_type, ret_type) +#define __OLD_GET1(name, val_type, ret_type) __P_OLD_GET1(__old_, name, val_type, ret_type) +#else +#define __OLD_GET(name, val_type, ret_type) __P_OLD_GET(, name, val_type, ret_type) +#define __OLD_GET1(name, val_type, ret_type) __P_OLD_GET1(, name, val_type, ret_type) +#endif + __OLD_GET(snd_pcm_hw_params_get_access, snd_pcm_access_t, int); __OLD_GET(snd_pcm_hw_params_get_format, snd_pcm_format_t, int); __OLD_GET(snd_pcm_hw_params_get_subformat, snd_pcm_subformat_t, int); @@ -6221,22 +6235,30 @@ __OLD_GET1(snd_pcm_hw_params_get_buffer_time_max, unsigned int, unsigned int); __OLD_GET(snd_pcm_hw_params_get_buffer_size_max, snd_pcm_uframes_t, snd_pcm_uframes_t); __OLD_GET1(snd_pcm_hw_params_get_tick_time_max, unsigned int, unsigned int); -#define __OLD_NEAR(name, ret_type) \ -ret_type __old_##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ret_type val) \ +#define __P_OLD_NEAR(pfx, name, ret_type) \ +ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ret_type val) \ { \ if (INTERNAL(name)(pcm, params, &val) < 0) \ return 0; \ return (ret_type)val; \ } -#define __OLD_NEAR1(name, ret_type) \ -ret_type __old_##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ret_type val, int *dir) \ +#define __P_OLD_NEAR1(pfx, name, ret_type) \ +ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ret_type val, int *dir) \ { \ if (INTERNAL(name)(pcm, params, &val, dir) < 0) \ return 0; \ return (ret_type)val; \ } +#ifdef USE_VERSIONED_SYMBOLS +#define __OLD_NEAR(name, ret_type) __P_OLD_NEAR(__old_, name, ret_type) +#define __OLD_NEAR1(name, ret_type) __P_OLD_NEAR1(__old_, name, ret_type) +#else +#define __OLD_NEAR(name, ret_type) __P_OLD_NEAR(, name, ret_type) +#define __OLD_NEAR1(name, ret_type) __P_OLD_NEAR1(, name, ret_type) +#endif + __OLD_NEAR(snd_pcm_hw_params_set_channels_near, unsigned int); __OLD_NEAR1(snd_pcm_hw_params_set_rate_near, unsigned int); __OLD_NEAR1(snd_pcm_hw_params_set_period_time_near, unsigned int); @@ -6246,8 +6268,8 @@ __OLD_NEAR1(snd_pcm_hw_params_set_buffer_time_near, unsigned int); __OLD_NEAR(snd_pcm_hw_params_set_buffer_size_near, snd_pcm_uframes_t); __OLD_NEAR1(snd_pcm_hw_params_set_tick_time_near, unsigned int); -#define __OLD_SET_FL(name, ret_type) \ -ret_type __old_##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) \ +#define __P_OLD_SET_FL(pfx, name, ret_type) \ +ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) \ { \ ret_type val; \ if (INTERNAL(name)(pcm, params, &val) < 0) \ @@ -6255,8 +6277,8 @@ ret_type __old_##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) \ return (ret_type)val; \ } -#define __OLD_SET_FL1(name, ret_type) \ -ret_type __old_##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir) \ +#define __P_OLD_SET_FL1(pfx, name, ret_type) \ +ret_type pfx##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir) \ { \ ret_type val; \ if (INTERNAL(name)(pcm, params, &val, dir) < 0) \ @@ -6264,6 +6286,14 @@ ret_type __old_##name(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir) \ return (ret_type)val; \ } +#ifdef USE_VERSIONED_SYMBOLS +#define __OLD_SET_FL(name, ret_type) __P_OLD_SET_FL(__old_, name, ret_type) +#define __OLD_SET_FL1(name, ret_type) __P_OLD_SET_FL1(__old_, name, ret_type) +#else +#define __OLD_SET_FL(name, ret_type) __P_OLD_SET_FL(, name, ret_type) +#define __OLD_SET_FL1(name, ret_type) __P_OLD_SET_FL1(, name, ret_type) +#endif + __OLD_SET_FL(snd_pcm_hw_params_set_access_first, snd_pcm_access_t); __OLD_SET_FL(snd_pcm_hw_params_set_format_first, snd_pcm_format_t); __OLD_SET_FL(snd_pcm_hw_params_set_subformat_first, snd_pcm_subformat_t); @@ -6356,6 +6386,4 @@ OBSOLETE1(snd_pcm_hw_params_set_tick_time_near, ALSA_0.9, ALSA_0.9.0rc4); OBSOLETE1(snd_pcm_hw_params_set_tick_time_first, ALSA_0.9, ALSA_0.9.0rc4); OBSOLETE1(snd_pcm_hw_params_set_tick_time_last, ALSA_0.9, ALSA_0.9.0rc4); -#endif /* USE_VERSIONED_SYMBOLS */ - #endif /* DOC_HIDDEN */ diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h index 247b32ab..2d8ab61f 100644 --- a/src/pcm/pcm_local.h +++ b/src/pcm/pcm_local.h @@ -636,9 +636,9 @@ int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, u int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); -int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); -int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); -int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int INTERNAL(snd_pcm_hw_params_set_periods_near)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int INTERNAL(snd_pcm_hw_params_set_periods_first)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int INTERNAL(snd_pcm_hw_params_set_periods_last)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); int INTERNAL(snd_pcm_hw_params_get_buffer_time)(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); -- 2.11.0