speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autotools and ifdefs


From: Andrei Kholodnyi
Subject: autotools and ifdefs
Date: Mon, 6 Dec 2010 20:18:37 +0100

On Mon, Dec 6, 2010 at 10:25 AM, Bohdan R. Rau <ethanak at polip.com> wrote:
> On Sun, 5 Dec 2010 15:07:25 -0600, William Hubbs <w.d.hubbs at gmail.com>
> wrote:
> [...]
>>>
>>> +#ifdef HAVE_SAMPLERATE
>>> + ? ?float rsbuf[SONIC_BUFFER_SIZE];
>>> + ? ?SRC_STATE *resampler=NULL;
>>> + ? ?SRC_DATA resdata;
>>> +#endif
>>
>> I wouldn't have a problem with this #ifdef, because it is blocking off
>> certain statements, probably based on something defined in
>> config.h.
>
> Exactly.
>
> Supersonic may be compiled without libsamplerate (in this case "pitch"
> parameter is simply ignored).

well, I'd rather implement a separate function which covers only
dependent on libsamplerate functionality
and then based on the availability of libsamplerate include it in the
build or use a dummy function instead

>
> [...]
>>
>>> + ? ?if (!rate
>>> +#ifdef HAVE_SAMPLERATE
>>> + ? ? ? ? ? ?&& !pitch
>>> +#endif
>>> + ? ? ? ? ? ?) {
>>
>> ?This, on the other hand, I definitely disagree with. ?I do not agree
>> ?with using #ifdef's to break up conditionals like this.
>
> So - what's your suggestion in this case?

rethink the way of integration.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]