From 37388ebb0ef9085c841d7f94e665a5a77cfe0e92 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 16 Jul 2013 13:28:28 +0200 Subject: configure: uniform the defines to #define HAVE_xxx (0|1) The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related --- stream/audio_in.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'stream/audio_in.h') diff --git a/stream/audio_in.h b/stream/audio_in.h index 2f42685c7c..af2cecd28d 100644 --- a/stream/audio_in.h +++ b/stream/audio_in.h @@ -25,7 +25,7 @@ #include "config.h" -#ifdef CONFIG_ALSA +#if HAVE_ALSA #include typedef struct { @@ -38,7 +38,7 @@ typedef struct { } ai_alsa_t; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO typedef struct { char *device; @@ -46,7 +46,7 @@ typedef struct { } ai_oss_t; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO #include typedef struct { @@ -72,13 +72,13 @@ typedef struct int bytes_per_sample; int samplesize; -#ifdef CONFIG_ALSA +#if HAVE_ALSA ai_alsa_t alsa; #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO ai_oss_t oss; #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO ai_sndio_t sndio; #endif } audio_in_t; @@ -92,19 +92,19 @@ int audio_in_uninit(audio_in_t *ai); int audio_in_start_capture(audio_in_t *ai); int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer); -#ifdef CONFIG_ALSA +#if HAVE_ALSA int ai_alsa_setup(audio_in_t *ai); int ai_alsa_init(audio_in_t *ai); int ai_alsa_xrun(audio_in_t *ai); #endif -#ifdef CONFIG_OSS_AUDIO +#if HAVE_OSS_AUDIO int ai_oss_set_samplerate(audio_in_t *ai); int ai_oss_set_channels(audio_in_t *ai); int ai_oss_init(audio_in_t *ai); #endif -#ifdef CONFIG_SNDIO +#if HAVE_SNDIO int ai_sndio_setup(audio_in_t *ai); int ai_sndio_init(audio_in_t *ai); #endif -- cgit v1.2.3