From: Andre Noll Date: Sun, 29 Jun 2014 09:39:28 +0000 (+0200) Subject: afh_common.c: Avoid ifdefs. X-Git-Tag: v0.5.4~1^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=4f112bad9a4b61b8e1ce54cf2cb24285d9c81a6b afh_common.c: Avoid ifdefs. For each optional audio format we currently have two #ifdefs in afh_common.c: the first one controls whether cpp emits the declaration of the corresponding init function of the audio format handler while the second #ifdef prevents the ->init pointer from being initialized for unsupported audio formats. Declaring also those init functions which end up as undefined symbols causes no problems because we never refer to them due to the second set of #ifdefs. Hence let's just get rid of the first set of #ifdefs and declare all xxx_init() functions unconditionally. --- diff --git a/afh_common.c b/afh_common.c index fc0df417..edfc8d1d 100644 --- a/afh_common.c +++ b/afh_common.c @@ -15,27 +15,10 @@ #include "string.h" #include "afh.h" -/* The mp3 audio format handler does not need any libs. */ -void mp3_init(struct audio_format_handler *); - -#ifdef HAVE_OGGVORBIS - void ogg_init(struct audio_format_handler *); -#endif -#ifdef HAVE_FAAD - void aac_afh_init(struct audio_format_handler *); -#endif -#ifdef HAVE_SPEEX - void spx_afh_init(struct audio_format_handler *); -#endif -#ifdef HAVE_FLAC - void flac_afh_init(struct audio_format_handler *); -#endif - -#ifdef HAVE_OPUS - void opus_afh_init(struct audio_format_handler *); -#endif - -void wma_afh_init(struct audio_format_handler *); +typedef void afh_init_func(struct audio_format_handler *); +/* It does not hurt to declare init functions which are not available. */ +extern afh_init_func mp3_init, ogg_init, aac_afh_init, wma_afh_init, + spx_afh_init, flac_afh_init, opus_afh_init; /** The list of all status items */ const char *status_item_list[] = {STATUS_ITEM_ARRAY};