Conditionally compiling for 1.0.9 and later ?

Dave Raggett
2006-01-07T11:37:57Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am looking for advice on the best way to conditionally
compile application code to use hardware resampling for
ALSA when this is available. One possible approach is to
do an #ifdef on SNDRV_PCM_HW_PARAMS_NORESAMPLE as show
below, but is there a better way?

#ifdef SNDRV_PCM_HW_PARAMS_NORESAMPLE
/* set hardware resampling */
err = snd_pcm_hw_params_set_rate_resample(handle,
params, resample);
if (err < 0)
{
printf("Resampling setup failed for playback: %s\n",
snd_strerror(err));
return err;
}
#endif

p.s. I understand that snd_pcm_hw_params_set_rate_resample()
was first introduced in version 1.0.9 and found that
SNDRV_PCM_HW_PARAMS_NORESAMPLE first appeared in that version.
My goal is allow my code to compile with earlier versions of
ALSA when so needed.

Many thanks,
- --
Dave Raggett <dsr@w3.org> W3C lead for multimodal interaction
http://www.w3.org/People/Raggett +44 1225 866240 (or 867351)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFDv6glb3AdEmxAsUsRAgUOAKC2ErZLNeCUw5pvd2XgTatNM5O4+wCg4udi
tA6hKBXy77dMokISn+tJmrU=
=ODw7
-----END PGP SIGNATURE-----