From 95b3430f5277cf36bc9acc989e301ae302747a98 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Dec 2008 17:28:32 +0100 Subject: removed os_compat.h Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable. --- src/Makefile.am | 1 - src/audio.c | 3 +- src/cmdline.c | 1 + src/command.c | 4 ++- src/compress.c | 4 ++- src/conf.c | 3 +- src/database.c | 7 ++++- src/decoder/wavpack_plugin.c | 2 ++ src/directory_save.c | 3 ++ src/dirvec.c | 4 ++- src/listen.c | 12 ++++++-- src/ls.c | 3 +- src/main.c | 9 +++++- src/mapper.c | 6 +++- src/os_compat.h | 70 -------------------------------------------- src/output_list.c | 1 - src/path.c | 3 +- src/path.h | 3 +- src/permission.c | 4 +-- src/player_control.c | 4 ++- src/playlist.c | 7 ++++- src/signal_check.c | 5 +++- src/song.c | 5 ++++ src/stats.c | 2 -- src/stored_playlist.c | 8 ++++- src/strset.c | 4 ++- src/update.c | 7 +++++ src/volume.c | 10 ++++--- src/zeroconf.c | 5 ++-- src/zeroconf.h | 2 +- 30 files changed, 99 insertions(+), 103 deletions(-) delete mode 100644 src/os_compat.h diff --git a/src/Makefile.am b/src/Makefile.am index 58f1bf02d..9f6c8ea35 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,6 @@ mpd_headers = \ main_notify.h \ normalize.h \ compress.h \ - os_compat.h \ pipe.h \ path.h \ mapper.h \ diff --git a/src/audio.c b/src/audio.c index 1fba0ace0..89752e305 100644 --- a/src/audio.c +++ b/src/audio.c @@ -25,10 +25,11 @@ #include "client.h" #include "idle.h" #include "utils.h" -#include "os_compat.h" #include +#include + #define AUDIO_DEVICE_STATE "audio_device_state:" #define AUDIO_BUFFER_SIZE 2*MPD_PATH_MAX diff --git a/src/cmdline.c b/src/cmdline.c index feba99a3b..f1d3bcc7d 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -30,6 +30,7 @@ #include #include +#include #define SYSTEM_CONFIG_FILE_LOCATION "/etc/mpd.conf" #define USER_CONFIG_FILE_LOCATION ".mpdconf" diff --git a/src/command.c b/src/command.c index 326a0499d..c9b2fcbd2 100644 --- a/src/command.c +++ b/src/command.c @@ -38,9 +38,11 @@ #include "client.h" #include "tag_print.h" #include "path.h" -#include "os_compat.h" #include "idle.h" +#include +#include + #define COMMAND_STATUS_VOLUME "volume" #define COMMAND_STATUS_STATE "state" #define COMMAND_STATUS_REPEAT "repeat" diff --git a/src/compress.c b/src/compress.c index 3d8b913b4..b561cb045 100644 --- a/src/compress.c +++ b/src/compress.c @@ -20,10 +20,12 @@ * */ -#include "os_compat.h" #include "compress.h" #include "utils.h" +#include +#include + #ifdef USE_X #include #include diff --git a/src/conf.c b/src/conf.c index e11936db6..583980cc1 100644 --- a/src/conf.c +++ b/src/conf.c @@ -21,10 +21,11 @@ #include "buffer2array.h" #include "list.h" #include "path.h" -#include "os_compat.h" #include +#include + #define MAX_STRING_SIZE MPD_PATH_MAX+80 #define CONF_COMMENT '#' diff --git a/src/database.c b/src/database.c index a90c22a98..ebfc9091a 100644 --- a/src/database.c +++ b/src/database.c @@ -30,10 +30,15 @@ #include "dbUtils.h" #include "update.h" #include "main_notify.h" +#include "config.h" +#include + +#include +#include +#include #include #include -#include static struct directory *music_root; diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index 70a02f284..b96de361e 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -24,6 +24,8 @@ #include #include + +#include #include /* pick 1020 since its devisible for 8,16,24, and 32-bit audio */ diff --git a/src/directory_save.c b/src/directory_save.c index 289f6df3b..748b3addd 100644 --- a/src/directory_save.c +++ b/src/directory_save.c @@ -26,6 +26,9 @@ #include +#include +#include + /* TODO error checking */ int directory_save(FILE *fp, struct directory *directory) diff --git a/src/dirvec.c b/src/dirvec.c index cf65fe659..6e921a75b 100644 --- a/src/dirvec.c +++ b/src/dirvec.c @@ -3,9 +3,11 @@ #include "utils.h" #include "path.h" -#include #include +#include +#include + static GMutex *nr_lock = NULL; static size_t dv_size(const struct dirvec *dv) diff --git a/src/listen.c b/src/listen.c index 5a2b8d3da..c0c514f2d 100644 --- a/src/listen.c +++ b/src/listen.c @@ -21,9 +21,15 @@ #include "conf.h" #include "log.h" #include "utils.h" -#include "os_compat.h" - -#include "../config.h" +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include #define MAXHOSTNAME 1024 diff --git a/src/ls.c b/src/ls.c index 22b2fc9fc..30eb3fd70 100644 --- a/src/ls.c +++ b/src/ls.c @@ -23,7 +23,8 @@ #include "log.h" #include "list.h" #include "stored_playlist.h" -#include "os_compat.h" + +#include static const char *remoteUrlPrefixes[] = { #ifdef HAVE_CURL diff --git a/src/main.c b/src/main.c index babb17c25..0f8ff30e9 100644 --- a/src/main.c +++ b/src/main.c @@ -49,7 +49,6 @@ #include "normalize.h" #include "zeroconf.h" #include "main_notify.h" -#include "os_compat.h" #include "dirvec.h" #include "songvec.h" #include "tag_pool.h" @@ -60,6 +59,14 @@ #include +#include +#include +#include +#include +#include +#include +#include + #ifdef HAVE_LOCALE #include #endif diff --git a/src/mapper.c b/src/mapper.c index b3f86da00..e9364f878 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -26,10 +26,14 @@ #include "path.h" #include "conf.h" +#include + +#include #include #include #include -#include +#include +#include static char *music_dir; static size_t music_dir_length; diff --git a/src/os_compat.h b/src/os_compat.h deleted file mode 100644 index 0a9673bc0..000000000 --- a/src/os_compat.h +++ /dev/null @@ -1,70 +0,0 @@ -/* the Music Player Daemon (MPD) - * Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com) - * This project's homepage is: http://www.musicpd.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef MPD_OS_COMPAT_H -#define MPD_OS_COMPAT_H - -#include "../config.h" - -/* - * This includes OS-wide headers that can be expected to be available - * on any machine that mpd can be compiled on for any UNIX-like OS. - * - * This does not include headers for optional dependencies such as - * those for: - * 1) input/output plugins - * 2) optional features in core (libsamplerate, avahi, ...) - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* needed? this defines NULL + offsetof() */ -#include - -#ifdef HAVE_UN -#include -#endif - -#endif /* OS_COMPAT_H */ diff --git a/src/output_list.c b/src/output_list.c index 7068703f0..c1af80917 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -18,7 +18,6 @@ #include "output_list.h" #include "output_api.h" -#include "os_compat.h" extern const struct audio_output_plugin shoutPlugin; extern const struct audio_output_plugin nullPlugin; diff --git a/src/path.c b/src/path.c index 3baa96bb2..1d1c3314d 100644 --- a/src/path.c +++ b/src/path.c @@ -21,10 +21,11 @@ #include "conf.h" #include "utils.h" #include "playlist.h" -#include "os_compat.h" #include +#include + static char *fs_charset; char *fs_charset_to_utf8(char *dst, const char *str) diff --git a/src/path.h b/src/path.h index 16ddb9ed4..e99c02f05 100644 --- a/src/path.h +++ b/src/path.h @@ -19,7 +19,8 @@ #ifndef MPD_PATH_H #define MPD_PATH_H -#include "os_compat.h" +#include +#include #if !defined(MPD_PATH_MAX) # if defined(MAXPATHLEN) diff --git a/src/permission.c b/src/permission.c index 15e2382b5..e65561ec5 100644 --- a/src/permission.c +++ b/src/permission.c @@ -17,14 +17,14 @@ */ #include "permission.h" - #include "conf.h" #include "log.h" #include "utils.h" -#include "os_compat.h" #include + #include +#include #define PERMISSION_PASSWORD_CHAR "@" #define PERMISSION_SEPERATOR "," diff --git a/src/player_control.c b/src/player_control.c index b8e9499f6..049207ae7 100644 --- a/src/player_control.c +++ b/src/player_control.c @@ -23,9 +23,11 @@ #include "song.h" #include "idle.h" #include "pcm_utils.h" -#include "os_compat.h" #include "main_notify.h" +#include +#include + struct player_control pc; void pc_init(unsigned int buffered_before_play) diff --git a/src/playlist.c b/src/playlist.c index 18068b77c..64bd4270a 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -36,10 +36,15 @@ #include "ack.h" #include "idle.h" #include "list.h" -#include "os_compat.h" #include +#include +#include +#include +#include +#include + #define PLAYLIST_STATE_STOP 0 #define PLAYLIST_STATE_PLAY 1 diff --git a/src/signal_check.c b/src/signal_check.c index 5cf16e987..e759759e2 100644 --- a/src/signal_check.c +++ b/src/signal_check.c @@ -18,7 +18,10 @@ */ #include "signal_check.h" -#include "os_compat.h" + +#include +#include +#include static volatile sig_atomic_t caught_signals[NSIG]; diff --git a/src/song.c b/src/song.c index 56ece8eaf..b7a8d2f8a 100644 --- a/src/song.c +++ b/src/song.c @@ -27,6 +27,11 @@ #include "decoder_list.h" #include "decoder_api.h" +#include +#include +#include +#include + static struct song * song_alloc(const char *url, struct directory *parent) { diff --git a/src/stats.c b/src/stats.c index fe842a789..53c785614 100644 --- a/src/stats.c +++ b/src/stats.c @@ -18,14 +18,12 @@ */ #include "stats.h" - #include "database.h" #include "tag.h" #include "song.h" #include "client.h" #include "player_control.h" #include "strset.h" -#include "os_compat.h" Stats stats; diff --git a/src/stored_playlist.c b/src/stored_playlist.c index 034dfccb6..545ecc158 100644 --- a/src/stored_playlist.c +++ b/src/stored_playlist.c @@ -25,7 +25,13 @@ #include "ls.h" #include "database.h" #include "idle.h" -#include "os_compat.h" + +#include +#include +#include +#include +#include +#include static struct stored_playlist_info * load_playlist_info(const char *parent_path_fs, const char *name_fs) diff --git a/src/strset.c b/src/strset.c index eee5b2901..8462736df 100644 --- a/src/strset.c +++ b/src/strset.c @@ -18,7 +18,9 @@ #include "strset.h" #include "utils.h" -#include "os_compat.h" + +#include +#include #define NUM_SLOTS 16384 diff --git a/src/update.c b/src/update.c index 776fa050b..e0c418fed 100644 --- a/src/update.c +++ b/src/update.c @@ -35,6 +35,13 @@ #include +#include +#include +#include +#include +#include +#include + static enum update_progress { UPDATE_PROGRESS_IDLE = 0, UPDATE_PROGRESS_RUNNING = 1, diff --git a/src/volume.c b/src/volume.c index 2603aeede..9c7114e16 100644 --- a/src/volume.c +++ b/src/volume.c @@ -15,21 +15,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "volume.h" +#include "volume.h" #include "conf.h" #include "log.h" #include "player_control.h" #include "utils.h" #include "idle.h" #include "pcm_utils.h" -#include "os_compat.h" - -#include "../config.h" +#include "config.h" #include +#include +#include + #ifdef HAVE_OSS +#include #include #endif #ifdef HAVE_ALSA diff --git a/src/zeroconf.c b/src/zeroconf.c index 74351256c..d4757418a 100644 --- a/src/zeroconf.c +++ b/src/zeroconf.c @@ -16,10 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../config.h" - #include "zeroconf.h" -#include "os_compat.h" #include "conf.h" #include "log.h" #include "listen.h" @@ -28,6 +25,8 @@ #include +#include + /* The dns-sd service type qualifier to publish */ #define SERVICE_TYPE "_mpd._tcp" diff --git a/src/zeroconf.h b/src/zeroconf.h index a18c23f8c..4ebe9e22a 100644 --- a/src/zeroconf.h +++ b/src/zeroconf.h @@ -19,7 +19,7 @@ #ifndef MPD_ZEROCONF_H #define MPD_ZEROCONF_H -#include "../config.h" +#include "config.h" #ifdef HAVE_ZEROCONF -- cgit v1.2.3