diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-22 11:31:06 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-11-04 11:02:10 +0100 |
commit | 6fd304e5e6c8b386d3671f4932a74124fd37192a (patch) | |
tree | 0110c5339a4fe42276017f1fd74373baa1e25f22 /src | |
parent | d3018bfbb5f5712e6fe0f7ce534a362a0518d2c2 (diff) |
Switch from autotools to a custom build system adapted from Libav.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 252 | ||||
-rw-r--r-- | src/archive_list.c | 6 | ||||
-rw-r--r-- | src/check.h | 2 | ||||
-rw-r--r-- | src/client_new.c | 4 | ||||
-rw-r--r-- | src/command.c | 8 | ||||
-rw-r--r-- | src/decoder/ffmpeg_decoder_plugin.c | 1 | ||||
-rw-r--r-- | src/fd_util.c | 12 | ||||
-rw-r--r-- | src/inotify_update.h | 16 | ||||
-rw-r--r-- | src/input_registry.c | 30 | ||||
-rw-r--r-- | src/log.c | 10 | ||||
-rw-r--r-- | src/main.c | 12 | ||||
-rw-r--r-- | src/output_list.c | 34 | ||||
-rw-r--r-- | src/pcm_resample.c | 20 | ||||
-rw-r--r-- | src/pcm_resample.h | 4 | ||||
-rw-r--r-- | src/pcm_resample_internal.h | 2 | ||||
-rw-r--r-- | src/resolver.c | 16 | ||||
-rw-r--r-- | src/server_socket.c | 28 | ||||
-rw-r--r-- | src/update_archive.c | 2 | ||||
-rw-r--r-- | src/update_archive.h | 2 | ||||
-rw-r--r-- | src/update_remove.c | 4 | ||||
-rw-r--r-- | src/zeroconf.c | 8 | ||||
-rw-r--r-- | src/zeroconf.h | 2 |
22 files changed, 351 insertions, 124 deletions
diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..2806667f --- /dev/null +++ b/src/Makefile @@ -0,0 +1,252 @@ +OBJS = aiff.o \ + ape.o \ + archive_api.o \ + archive_list.o \ + archive_plugin.o \ + audio_check.o \ + audio_config.o \ + audio_format.o \ + audio_parser.o \ + buffer.o \ + chunk.o \ + client.o \ + client_event.o \ + client_expire.o \ + client_file.o \ + client_global.o \ + client_idle.o \ + client_list.o \ + client_message.o \ + client_new.o \ + client_process.o \ + client_read.o \ + client_subscribe.o \ + client_write.o \ + cmdline.o \ + command.o \ + conf.o \ + crossfade.o \ + daemon.o \ + database.o \ + db_lock.o \ + db_print.o \ + db_save.o \ + dbUtils.o \ + decoder_api.o \ + decoder_buffer.o \ + decoder_control.o \ + decoder_internal.o \ + decoder_list.o \ + decoder_plugin.o \ + decoder_print.o \ + decoder_thread.o \ + directory.o \ + directory_save.o \ + encoder_list.o \ + event_pipe.o \ + exclude.o \ + fd_util.o \ + fifo_buffer.o \ + filter_config.o \ + filter_plugin.o \ + filter_registry.o \ + growing_fifo.o \ + icy_metadata.o \ + icy_server.o \ + idle.o \ + inotify_queue.o \ + inotify_source.o \ + inotify_update.o \ + input_init.o \ + input_internal.o \ + input_registry.o \ + input_stream.o \ + io_thread.o \ + listen.o \ + locate.o \ + log.o \ + ls.o \ + main.o \ + main_win32.o \ + mapper.o \ + mixer_all.o \ + mixer_api.o \ + mixer_control.o \ + mixer_type.o \ + notify.o \ + output_all.o \ + output_command.o \ + output_control.o \ + output_finish.o \ + output_init.o \ + output_list.o \ + output_plugin.o \ + output_print.o \ + output_state.o \ + output_thread.o \ + page.o \ + path.o \ + pcm_buffer.o \ + pcm_channels.o \ + pcm_convert.o \ + pcm_dither.o \ + pcm_dsd.o \ + pcm_dsd_usb.o \ + pcm_export.o \ + pcm_format.o \ + pcm_mix.o \ + pcm_pack.o \ + pcm_resample.o \ + pcm_resample_fallback.o \ + pcm_resample_libsamplerate.o \ + pcm_volume.o \ + permission.o \ + pipe.o \ + player_control.o \ + player_thread.o \ + playlist_any.o \ + playlist.o \ + playlist_control.o \ + playlist_database.o \ + playlist_edit.o \ + playlist_global.o \ + playlist_list.o \ + playlist_mapper.o \ + playlist_print.o \ + playlist_queue.o \ + playlist_save.o \ + playlist_song.o \ + playlist_state.o \ + playlist_vector.o \ + queue.o \ + queue_print.o \ + queue_save.o \ + replay_gain_ape.o \ + replay_gain_config.o \ + replay_gain_info.o \ + resolver.o \ + riff.o \ + server_socket.o \ + sig_handlers.o \ + socket_util.o \ + song.o \ + song_print.o \ + song_save.o \ + song_sort.o \ + song_sticker.o \ + song_update.o \ + state_file.o \ + stats.o \ + sticker.o \ + sticker_print.o \ + stored_playlist.o \ + string_util.o \ + strset.o \ + tag_ape.o \ + tag.o \ + tag_file.o \ + tag_handler.o \ + tag_pool.o \ + tag_print.o \ + tag_save.o \ + text_file.o \ + text_input_stream.o \ + timer.o \ + tokenizer.o \ + update_archive.o \ + update.o \ + update_container.o \ + update_db.o \ + update_io.o \ + update_queue.o \ + update_remove.o \ + update_song.o \ + update_walk.o \ + uri.o \ + utils.o \ + volume.o \ + encoder/null_encoder.o \ + AudioCompress/compress.o \ + cue/cue_parser.o \ + db/simple_db_plugin.o \ + decoder/ffmpeg_decoder_plugin.o \ + decoder/ffmpeg_metadata.o \ + dsd2pcm/dsd2pcm.o \ + dsd2pcm/noiseshape.o \ + filter/autoconvert_filter_plugin.o \ + filter/chain_filter_plugin.o \ + filter/convert_filter_plugin.o \ + filter/normalize_filter_plugin.o \ + filter/null_filter_plugin.o \ + filter/replay_gain_filter_plugin.o \ + filter/route_filter_plugin.o \ + filter/volume_filter_plugin.o \ + input/archive_input_plugin.o \ + mixer/software_mixer_plugin.o \ + playlist/asx_playlist_plugin.o \ + playlist/cue_playlist_plugin.o \ + playlist/embcue_playlist_plugin.o \ + playlist/extm3u_playlist_plugin.o \ + playlist/lastfm_playlist_plugin.o \ + playlist/m3u_playlist_plugin.o \ + playlist/pls_playlist_plugin.o \ + playlist/rss_playlist_plugin.o \ + playlist/xspf_playlist_plugin.o \ + protocol/argparser.o \ + protocol/result.o \ + util/bit_reverse.o \ + util/byte_reverse.o \ + util/list_sort.o \ + +OBJS-$(CONFIG_LAME_ENCODER) += encoder/lame_encoder.o +OBJS-$(CONFIG_FLAC_ENCODER) += encoder/flac_encoder.o +OBJS-$(CONFIG_TWOLAME_ENCODER) += encoder/twolame_encoder.o +OBJS-$(CONFIG_VORBIS_ENCODER) += encoder/vorbis_encoder.o +OBJS-$(CONFIG_WAVE_ENCODER) += encoder/wave_encoder.o + +OBJS-$(CONFIG_BZ2_ARCHIVE) += archive/bz2_archive_plugin.o +OBJS-$(CONFIG_ISO9660_ARCHIVE) += archive/iso9660_archive_plugin.o +OBJS-$(CONFIG_ZZIP_ARCHIVE) += archive/zzip_archive_plugin.o + +OBJS-$(CONFIG_CDIO_PARANOIA_INPUT) += input/cdio_paranoia_input_plugin.o +OBJS-$(CONFIG_CURL_PROTOCL) += input/curl_input_plugin.o +OBJS-$(CONFIG_DESPOTIFY_INPUT) += input/despotify_input_plugin.o \ + despotify_utils.o \ + playlist/despotify_playlist_plugin.o +OBJS-$(CONFIG_FFMPEG_INPUT) += input/ffmpeg_input_plugin.o +OBJS-$(CONFIG_FILE_INPUT) += input/file_input_plugin.o +OBJS-$(CONFIG_REWIND_INPUT) += input/rewind_input_plugin.o +OBJS-$(CONFIG_SOUNDCLOUD_INPUT) += playlist/soundcloud_playlist_plugin.o +OBJS-$(CONFIG_SOUP_INPUT) += input/soup_input_plugin.o + +OBJS-$(CONFIG_ALSA_OUTPUT) += mixer/alsa_mixer_plugin.o \ + output/alsa_output_plugin.o +OBJS-$(CONFIG_OSS_OUTPUT) += mixer/oss_mixer_plugin.o \ + output/oss_output_plugin.o +OBJS-$(CONFIG_PULSE_OUTPUT) += mixer/pulse_mixer_plugin.o \ + output/pulse_output_plugin.o +OBJS-$(CONFIG_ROAR_OUTPUT) += mixer/roar_mixer_plugin.o \ + output/roar_output_plugin.o +OBJS-$(CONFIG_WINMM_OUTPUT) += mixer/winmm_mixer_plugin.o \ + output/winmm_output_plugin.o +OBJS-$(CONFIG_AO_OUTPUT) += output/ao_output_plugin.o +OBJS-$(CONFIG_FFADO_OUTPUT) += output/ffado_output_plugin.o +OBJS-$(CONFIG_FIFO_OUTPUT) += output/fifo_output_plugin.o +OBJS-$(CONFIG_HTTPD_OUTPUT) += output/httpd_client.o \ + output/httpd_output_plugin.o +OBJS-$(CONFIG_JACK_OUTPUT) += output/jack_output_plugin.o +OBJS-$(CONFIG_MVP_OUTPUT) += output/mvp_output_plugin.o +OBJS-$(CONFIG_NULL_OUTPUT) += output/null_output_plugin.o +OBJS-$(CONFIG_OPENAL_OUTPUT) += output/openal_output_plugin.o +OBJS-$(CONFIG_OSX_OUTPUT) += output/osx_output_plugin.o +OBJS-$(CONFIG_PIPE_OUTPUT) += output/pipe_output_plugin.o +OBJS-$(CONFIG_RECORDER_OUTPUT) += output/recorder_output_plugin.o +OBJS-$(CONFIG_SHOUT_OUTPUT) += output/shout_output_plugin.o +OBJS-$(CONFIG_SOLARIS_OUTPUT) += output/solaris_output_plugin.o + +OBJS-$(CONFIG_LIBID3TAG) += tag_id3.o \ + tag_rva2.o + +OBJS-$(CONFIG_ZEROCONF) += zeroconf.o +OBJS-$(CONFIG_AVAHI) += zeroconf-avahi.o +OBJS-$(CONFIG_BONJOUR) += zeroconf-bonjour.o diff --git a/src/archive_list.c b/src/archive_list.c index e23567bd..2cdb750c 100644 --- a/src/archive_list.c +++ b/src/archive_list.c @@ -29,13 +29,13 @@ #include <glib.h> const struct archive_plugin *const archive_plugins[] = { -#ifdef HAVE_BZ2 +#if CONFIG_BZ2_ARCHIVE &bz2_archive_plugin, #endif -#ifdef HAVE_ZZIP +#if CONFIG_ZZIP_ARCHIVE &zzip_archive_plugin, #endif -#ifdef HAVE_ISO9660 +#if CONFIG_ISO9660_ARCHIVE &iso9660_archive_plugin, #endif NULL diff --git a/src/check.h b/src/check.h index 0642a4b9..6baef90d 100644 --- a/src/check.h +++ b/src/check.h @@ -33,7 +33,7 @@ * */ -#ifndef PACKAGE_VERSION +#ifndef MPD_CONFIG_H #error config.h missing #endif diff --git a/src/client_new.c b/src/client_new.c index cf28c43c..4dba4d88 100644 --- a/src/client_new.c +++ b/src/client_new.c @@ -34,7 +34,7 @@ #endif #include <unistd.h> -#ifdef HAVE_LIBWRAP +#if CONFIG_LIBWRAP #include <tcpd.h> #endif @@ -54,7 +54,7 @@ client_new(struct player_control *player_control, assert(player_control != NULL); assert(fd >= 0); -#ifdef HAVE_LIBWRAP +#if CONFIG_LIBWRAP if (sa->sa_family != AF_UNIX) { char *hostaddr = sockaddr_to_string(sa, sa_length, NULL); const char *progname = g_get_prgname(); diff --git a/src/command.c b/src/command.c index 86d216a7..9cb0e69b 100644 --- a/src/command.c +++ b/src/command.c @@ -62,7 +62,7 @@ #include "song.h" #include "song_print.h" -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 #include "sticker.h" #include "sticker_print.h" #include "song_sticker.h" @@ -1655,7 +1655,7 @@ handle_idle(struct client *client, return 1; } -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 struct sticker_song_find_data { struct client *client; const char *name; @@ -2065,7 +2065,7 @@ static const struct command commands[] = { { "single", PERMISSION_CONTROL, 1, 1, handle_single }, { "stats", PERMISSION_READ, 0, 0, handle_stats }, { "status", PERMISSION_READ, 0, 0, handle_status }, -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 { "sticker", PERMISSION_ADMIN, 3, -1, handle_sticker }, #endif { "stop", PERMISSION_CONTROL, 0, 0, handle_stop }, @@ -2083,7 +2083,7 @@ static const unsigned num_commands = sizeof(commands) / sizeof(commands[0]); static bool command_available(G_GNUC_UNUSED const struct command *cmd) { -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 if (strcmp(cmd->cmd, "sticker") == 0) return sticker_enabled(); #endif diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index b6309440..cffbefcc 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -285,6 +285,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is, #endif #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0) +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 50000 uint8_t aligned_buffer[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16]; const size_t buffer_size = sizeof(aligned_buffer); #else diff --git a/src/fd_util.c b/src/fd_util.c index 882b4c7d..9807cd16 100644 --- a/src/fd_util.c +++ b/src/fd_util.c @@ -45,7 +45,7 @@ #include <sys/socket.h> #endif -#ifdef HAVE_INOTIFY_INIT +#if HAVE_INOTIFY_INIT #include <sys/inotify.h> #endif @@ -141,7 +141,7 @@ pipe_cloexec(int fd[2]) #else int ret; -#ifdef HAVE_PIPE2 +#if HAVE_PIPE2 ret = pipe2(fd, O_CLOEXEC); if (ret >= 0 || errno != ENOSYS) return ret; @@ -165,7 +165,7 @@ pipe_cloexec_nonblock(int fd[2]) #else int ret; -#ifdef HAVE_PIPE2 +#if HAVE_PIPE2 ret = pipe2(fd, O_CLOEXEC|O_NONBLOCK); if (ret >= 0 || errno != ENOSYS) return ret; @@ -258,7 +258,7 @@ accept_cloexec_nonblock(int fd, struct sockaddr *address, int ret; socklen_t address_length = *address_length_r; -#ifdef HAVE_ACCEPT4 +#if HAVE_ACCEPT4 ret = accept4(fd, address, &address_length, SOCK_CLOEXEC|SOCK_NONBLOCK); if (ret >= 0 || errno != ENOSYS) { @@ -306,14 +306,14 @@ recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags) #endif -#ifdef HAVE_INOTIFY_INIT +#if HAVE_INOTIFY_INIT int inotify_init_cloexec(void) { int fd; -#ifdef HAVE_INOTIFY_INIT1 +#if HAVE_INOTIFY_INIT1 fd = inotify_init1(IN_CLOEXEC); if (fd >= 0 || errno != ENOSYS) return fd; diff --git a/src/inotify_update.h b/src/inotify_update.h index ca75c0f4..9bf6e4df 100644 --- a/src/inotify_update.h +++ b/src/inotify_update.h @@ -22,26 +22,10 @@ #include "check.h" -#ifdef HAVE_INOTIFY_INIT - void mpd_inotify_init(unsigned max_depth); void mpd_inotify_finish(void); -#else /* !HAVE_INOTIFY_INIT */ - -static inline void -mpd_inotify_init(G_GNUC_UNUSED unsigned max_depth) -{ -} - -static inline void -mpd_inotify_finish(void) -{ -} - -#endif /* !HAVE_INOTIFY_INIT */ - #endif diff --git a/src/input_registry.c b/src/input_registry.c index dca49449..8581b3d3 100644 --- a/src/input_registry.c +++ b/src/input_registry.c @@ -20,28 +20,22 @@ #include "config.h" #include "input_registry.h" #include "input/file_input_plugin.h" - -#ifdef ENABLE_ARCHIVE #include "input/archive_input_plugin.h" -#endif +#include "input/ffmpeg_input_plugin.h" -#ifdef ENABLE_CURL +#if CONFIG_CURL_INPUT #include "input/curl_input_plugin.h" #endif -#ifdef ENABLE_SOUP +#if CONFIG_SOUP_INPUT #include "input/soup_input_plugin.h" #endif -#ifdef HAVE_FFMPEG -#include "input/ffmpeg_input_plugin.h" -#endif - -#ifdef ENABLE_CDIO_PARANOIA +#if CONFIG_CDIO_PARANOIA_INPUT #include "input/cdio_paranoia_input_plugin.h" #endif -#ifdef ENABLE_DESPOTIFY +#if CONFIG_DESPOTIFY_INPUT #include "input/despotify_input_plugin.h" #endif @@ -49,22 +43,18 @@ const struct input_plugin *const input_plugins[] = { &input_plugin_file, -#ifdef ENABLE_ARCHIVE + &input_plugin_ffmpeg, &input_plugin_archive, -#endif -#ifdef ENABLE_CURL +#if CONFIG_CURL_INPUT &input_plugin_curl, #endif -#ifdef ENABLE_SOUP +#if CONFIG_SOUP_INPUT &input_plugin_soup, #endif -#ifdef HAVE_FFMPEG - &input_plugin_ffmpeg, -#endif -#ifdef ENABLE_CDIO_PARANOIA +#if CONFIG_CDIO_PARANOIA_INPUT &input_plugin_cdio_paranoia, #endif -#ifdef ENABLE_DESPOTIFY +#if CONFIG_DESPOTIFY_INPUT &input_plugin_despotify, #endif NULL @@ -37,7 +37,7 @@ #include <errno.h> #include <glib.h> -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG #include <syslog.h> #endif @@ -149,7 +149,7 @@ log_init_file(const char *path, unsigned line, GError **error_r) return true; } -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG static int glib_to_syslog_level(GLogLevelFlags log_level) @@ -254,7 +254,7 @@ log_init(bool verbose, bool use_stdout, GError **error_r) } else { param = config_get_param(CONF_LOG_FILE); if (param == NULL) { -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG /* no configuration: default to syslog (if available) */ log_init_syslog(); @@ -265,7 +265,7 @@ log_init(bool verbose, bool use_stdout, GError **error_r) CONF_LOG_FILE); return false; #endif -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG } else if (strcmp(param->value, "syslog") == 0) { log_init_syslog(); return true; @@ -333,7 +333,7 @@ void close_log_files(void) if (stdout_mode) return; -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG if (out_filename == NULL) closelog(); #endif @@ -57,11 +57,11 @@ #include "tag_pool.h" #include "mpd_error.h" -#ifdef ENABLE_INOTIFY +#if CONFIG_INOTIFY #include "inotify_update.h" #endif -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 #include "sticker.h" #endif @@ -188,7 +188,7 @@ glue_db_init_and_load(void) static void glue_sticker_init(void) { -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 GError *error = NULL; char *sticker_file = config_dup_path(CONF_STICKER_FILE, &error); if (sticker_file == NULL && error != NULL) @@ -461,7 +461,7 @@ int mpd_main(int argc, char *argv[]) } success = config_get_bool(CONF_AUTO_UPDATE, false); -#ifdef ENABLE_INOTIFY +#if CONFIG_INOTIFY if (success && mapper_has_music_directory()) mpd_inotify_init(config_get_unsigned(CONF_AUTO_UPDATE_DEPTH, G_MAXUINT)); @@ -491,7 +491,7 @@ int mpd_main(int argc, char *argv[]) g_main_loop_unref(main_loop); -#ifdef ENABLE_INOTIFY +#if CONFIG_INOTIFY mpd_inotify_finish(); #endif @@ -507,7 +507,7 @@ int mpd_main(int argc, char *argv[]) g_debug("db_finish took %f seconds", ((float)(clock()-start))/CLOCKS_PER_SEC); -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 sticker_global_finish(); #endif diff --git a/src/output_list.c b/src/output_list.c index 835c02bb..8ec08abb 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -40,56 +40,56 @@ #include "output/winmm_output_plugin.h" const struct audio_output_plugin *const audio_output_plugins[] = { -#ifdef HAVE_SHOUT +#if CONFIG_SHOUT_OUTPUT &shout_output_plugin, #endif &null_output_plugin, -#ifdef HAVE_FIFO +#if CONFIG_FIFO_OUTPUT &fifo_output_plugin, #endif -#ifdef ENABLE_PIPE_OUTPUT +#if CONFIG_PIPE_OUTPUT &pipe_output_plugin, #endif -#ifdef HAVE_ALSA +#if CONFIG_ALSA_OUTPUT &alsa_output_plugin, #endif -#ifdef HAVE_ROAR +#if CONFIG_ROAR_OUTPUT &roar_output_plugin, #endif -#ifdef HAVE_AO +#if CONFIG_AO_OUTPUT &ao_output_plugin, #endif -#ifdef HAVE_OSS +#if CONFIG_OSS_OUTPUT &oss_output_plugin, #endif -#ifdef HAVE_OPENAL +#if CONFIG_OPENAL_OUTPUT &openal_output_plugin, #endif -#ifdef HAVE_OSX +#if CONFIG_OSX_OUTPUT &osx_output_plugin, #endif -#ifdef ENABLE_SOLARIS_OUTPUT +#if CONFIG_SOLARIS_OUTPUT &solaris_output_plugin, #endif -#ifdef HAVE_PULSE +#if CONFIG_PULSE_OUTPUT &pulse_output_plugin, #endif -#ifdef HAVE_MVP +#if CONFIG_MVP_OUTPUT &mvp_output_plugin, #endif -#ifdef HAVE_JACK +#if CONFIG_JACK_OUTPUT &jack_output_plugin, #endif -#ifdef ENABLE_HTTPD_OUTPUT +#if CONFIG_HTTPD_OUTPUT &httpd_output_plugin, #endif -#ifdef ENABLE_RECORDER_OUTPUT +#if CONFIG_RECORDER_OUTPUT &recorder_output_plugin, #endif -#ifdef ENABLE_WINMM_OUTPUT +#if CONFIG_WINMM_OUTPUT &winmm_output_plugin, #endif -#ifdef ENABLE_FFADO_OUTPUT +#if CONFIG_FFADO_OUTPUT &ffado_output_plugin, #endif NULL diff --git a/src/pcm_resample.c b/src/pcm_resample.c index 4bc057a7..bb75db6c 100644 --- a/src/pcm_resample.c +++ b/src/pcm_resample.c @@ -20,17 +20,17 @@ #include "config.h" #include "pcm_resample_internal.h" -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE #include "conf.h" #endif #include <string.h> -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE static bool lsr_enabled; #endif -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE static bool pcm_resample_lsr_enabled(void) { @@ -41,7 +41,7 @@ pcm_resample_lsr_enabled(void) bool pcm_resample_global_init(GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE const char *converter = config_get_string(CONF_SAMPLERATE_CONVERTER, ""); @@ -58,7 +58,7 @@ pcm_resample_global_init(GError **error_r) void pcm_resample_init(struct pcm_resample_state *state) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) pcm_resample_lsr_init(state); else @@ -68,7 +68,7 @@ void pcm_resample_init(struct pcm_resample_state *state) void pcm_resample_deinit(struct pcm_resample_state *state) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) pcm_resample_lsr_deinit(state); else @@ -79,7 +79,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state) void pcm_resample_reset(struct pcm_resample_state *state) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE pcm_resample_lsr_reset(state); #else (void)state; @@ -94,7 +94,7 @@ pcm_resample_float(struct pcm_resample_state *state, unsigned dest_rate, size_t *dest_size_r, GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) return pcm_resample_lsr_float(state, channels, src_rate, src_buffer, src_size, @@ -121,7 +121,7 @@ pcm_resample_16(struct pcm_resample_state *state, unsigned dest_rate, size_t *dest_size_r, GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) return pcm_resample_lsr_16(state, channels, src_rate, src_buffer, src_size, @@ -143,7 +143,7 @@ pcm_resample_32(struct pcm_resample_state *state, unsigned dest_rate, size_t *dest_size_r, GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) return pcm_resample_lsr_32(state, channels, src_rate, src_buffer, src_size, diff --git a/src/pcm_resample.h b/src/pcm_resample.h index a49a2414..8e73659d 100644 --- a/src/pcm_resample.h +++ b/src/pcm_resample.h @@ -27,7 +27,7 @@ #include <stddef.h> #include <stdbool.h> -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE #include <samplerate.h> #endif @@ -36,7 +36,7 @@ * holds buffer allocations and the state for the resampler. */ struct pcm_resample_state { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE SRC_STATE *state; SRC_DATA data; diff --git a/src/pcm_resample_internal.h b/src/pcm_resample_internal.h index a0e108d4..528ea2d6 100644 --- a/src/pcm_resample_internal.h +++ b/src/pcm_resample_internal.h @@ -30,7 +30,7 @@ #include "check.h" #include "pcm_resample.h" -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE bool pcm_resample_lsr_global_init(const char *converter, GError **error_r); diff --git a/src/resolver.c b/src/resolver.c index 243b7cd0..3ab0a50e 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -20,13 +20,13 @@ #include "config.h" #include "resolver.h" -#ifndef G_OS_WIN32 -#include <sys/socket.h> -#include <netdb.h> -#else /* G_OS_WIN32 */ +#if HAVE_WINSOCK2_H #include <ws2tcpip.h> #include <winsock.h> -#endif /* G_OS_WIN32 */ +#else +#include <sys/socket.h> +#include <netdb.h> +#endif #include <string.h> @@ -38,7 +38,7 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) struct sockaddr_in a4; #endif int ret; - char host[NI_MAXHOST], serv[NI_MAXSERV]; + char host[1024], serv[1024]; #if defined(HAVE_IPV6) && defined(IN6_IS_ADDR_V4MAPPED) if (sa->sa_family == AF_INET6 && @@ -64,14 +64,14 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) return NULL; } -#ifdef HAVE_UN +#if HAVE_UN if (sa->sa_family == AF_UNIX) /* "serv" contains corrupt information with unix sockets */ return g_strdup(host); #endif -#ifdef HAVE_IPV6 +#if HAVE_IPV6 if (strchr(host, ':') != NULL) return g_strconcat("[", host, "]:", serv, NULL); #endif diff --git a/src/server_socket.c b/src/server_socket.c index 39639959..4616fa25 100644 --- a/src/server_socket.c +++ b/src/server_socket.c @@ -19,7 +19,7 @@ #include "config.h" -#ifdef HAVE_STRUCT_UCRED +#if HAVE_STRUCT_UCRED #define _GNU_SOURCE 1 #endif @@ -127,7 +127,7 @@ one_socket_to_string(const struct one_socket *s) static int get_remote_uid(int fd) { -#ifdef HAVE_STRUCT_UCRED +#if HAVE_STRUCT_UCRED struct ucred cred; socklen_t len = sizeof (cred); @@ -136,7 +136,7 @@ get_remote_uid(int fd) return cred.uid; #else -#ifdef HAVE_GETPEEREID +#if HAVE_GETPEEREID uid_t euid; gid_t egid; @@ -346,7 +346,7 @@ server_socket_add_address(struct server_socket *ss, return s; } -#ifdef HAVE_TCP +#if 1 /** * Add a listener on a port on all IPv4 interfaces. @@ -385,13 +385,13 @@ server_socket_add_port_ipv6(struct server_socket *ss, unsigned port) } #endif /* HAVE_IPV6 */ -#endif /* HAVE_TCP */ +#endif bool server_socket_add_port(struct server_socket *ss, unsigned port, GError **error_r) { -#ifdef HAVE_TCP +#if 1 if (port == 0 || port > 0xffff) { g_set_error(error_r, server_socket_quark(), 0, "Invalid TCP port"); @@ -406,21 +406,21 @@ server_socket_add_port(struct server_socket *ss, unsigned port, ++ss->next_serial; return true; -#else /* HAVE_TCP */ +#else (void)ss; (void)port; g_set_error(error_r, server_socket_quark(), 0, "TCP support is disabled"); return false; -#endif /* HAVE_TCP */ +#endif } bool server_socket_add_host(struct server_socket *ss, const char *hostname, unsigned port, GError **error_r) { -#ifdef HAVE_TCP +#if 1 struct addrinfo *ai = resolve_host_port(hostname, port, AI_PASSIVE, SOCK_STREAM, error_r); @@ -435,7 +435,7 @@ server_socket_add_host(struct server_socket *ss, const char *hostname, ++ss->next_serial; return true; -#else /* HAVE_TCP */ +#else (void)ss; (void)hostname; (void)port; @@ -443,14 +443,14 @@ server_socket_add_host(struct server_socket *ss, const char *hostname, g_set_error(error_r, server_socket_quark(), 0, "TCP support is disabled"); return false; -#endif /* HAVE_TCP */ +#endif } bool server_socket_add_path(struct server_socket *ss, const char *path, GError **error_r) { -#ifdef HAVE_UN +#if CONFIG_UD struct sockaddr_un s_un; size_t path_length = strlen(path); @@ -471,13 +471,13 @@ server_socket_add_path(struct server_socket *ss, const char *path, s->path = g_strdup(path); return true; -#else /* !HAVE_UN */ +#else (void)ss; (void)path; g_set_error(error_r, server_socket_quark(), 0, "UNIX domain socket support is disabled"); return false; -#endif /* !HAVE_UN */ +#endif } diff --git a/src/update_archive.c b/src/update_archive.c index 3fb2bc18..932b5d86 100644 --- a/src/update_archive.c +++ b/src/update_archive.c @@ -137,7 +137,7 @@ update_archive_file(struct directory *directory, const char *name, const char *suffix, const struct stat *st) { -#ifdef ENABLE_ARCHIVE +#if CONFIG_ARCHIVES const struct archive_plugin *plugin = archive_plugin_from_suffix(suffix); if (plugin == NULL) diff --git a/src/update_archive.h b/src/update_archive.h index 838697dd..4be262f5 100644 --- a/src/update_archive.h +++ b/src/update_archive.h @@ -28,7 +28,7 @@ struct directory; struct archive_plugin; -#ifdef ENABLE_ARCHIVE +#if CONFIG_ARCHIVES bool update_archive_file(struct directory *directory, diff --git a/src/update_remove.c b/src/update_remove.c index f443f5eb..3dd67da6 100644 --- a/src/update_remove.c +++ b/src/update_remove.c @@ -24,7 +24,7 @@ #include "playlist.h" #include "main.h" -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 #include "sticker.h" #include "song_sticker.h" #endif @@ -53,7 +53,7 @@ song_remove_event(void) g_message("removing %s", uri); g_free(uri); -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 /* if the song has a sticker, remove it */ if (sticker_enabled()) sticker_song_delete(removed_song); diff --git a/src/zeroconf.c b/src/zeroconf.c index 4a399e4a..cd1c3fa7 100644 --- a/src/zeroconf.c +++ b/src/zeroconf.c @@ -51,11 +51,11 @@ void initZeroconf(void) serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME); -#ifdef HAVE_AVAHI +#if HAVE_AVAHI init_avahi(serviceName); #endif -#ifdef HAVE_BONJOUR +#if HAVE_BONJOUR init_zeroconf_osx(serviceName); #endif } @@ -65,11 +65,11 @@ void finishZeroconf(void) if (!zeroconfEnabled) return; -#ifdef HAVE_AVAHI +#if HAVE_AVAHI avahi_finish(); #endif /* HAVE_AVAHI */ -#ifdef HAVE_BONJOUR +#if HAVE_BONJOUR bonjour_finish(); #endif } diff --git a/src/zeroconf.h b/src/zeroconf.h index 8e33a3d8..7a792d7d 100644 --- a/src/zeroconf.h +++ b/src/zeroconf.h @@ -22,7 +22,7 @@ #include "check.h" -#ifdef HAVE_ZEROCONF +#if HAVE_ZEROCONF void initZeroconf(void); void finishZeroconf(void); |