]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
afh_common.c: Avoid ifdefs.
authorAndre Noll <maan@systemlinux.org>
Sun, 29 Jun 2014 09:39:28 +0000 (11:39 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 18 Jan 2015 14:40:47 +0000 (15:40 +0100)
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.

afh_common.c

index fc0df417fbc8405a21359ecd389075322f96f979..edfc8d1d08e79f333afce711aa814a374c8f1faf 100644 (file)
 #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};