speechd-discuss
[Top][All Lists]
Advanced

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

autotools and ifdefs


From: Bohdan R . Rau
Subject: autotools and ifdefs
Date: Mon, 06 Dec 2010 10:25:51 +0100

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).

[...]
> 
>> +    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?

#ifdef HAVE_SAMPLERATE
   if (!rate && !pitch)
#else
   if (!rate)
#endif

For me it's not good solution (I hate duplication of code)...

ethanak
-- 
http://milena.polip.com/ - Pa pa, Ivonko!



reply via email to

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