Cleanup #includes of standard system headers and put them in one place

This will make refactoring features easier, especially now that
pthreads support and larger refactorings are on the horizon.

Hopefully, this will make porting to other platforms (even
non-UNIX-like ones for masochists) easier, too.

os_compat.h will house all the #includes for system headers
considered to be the "core" of MPD.  Headers for optional
features will be left to individual source files.

git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong
2008-01-03 07:29:49 +00:00
parent 790e70cf25
commit cb8f1af3bd
93 changed files with 167 additions and 477 deletions

View File

@@ -18,8 +18,6 @@
#include "../audioOutput.h"
#include <stdlib.h>
#ifdef HAVE_ALSA
#define ALSA_PCM_NEW_HW_PARAMS_API
@@ -34,8 +32,7 @@
#include "../conf.h"
#include "../log.h"
#include <string.h>
#include "../os_compat.h"
#include <alsa/asoundlib.h>

View File

@@ -22,8 +22,7 @@
#include "../conf.h"
#include "../log.h"
#include <string.h>
#include "../os_compat.h"
#include <ao/ao.h>
@@ -240,7 +239,5 @@ AudioOutputPlugin aoPlugin = {
#else
#include <stdio.h>
DISABLED_AUDIO_OUTPUT_PLUGIN(aoPlugin)
#endif

View File

@@ -17,8 +17,7 @@
*/
#include "../audioOutput.h"
#include <stdlib.h>
#include "../os_compat.h"
#ifdef HAVE_FIFO
@@ -27,13 +26,6 @@
#include "../utils.h"
#include "../timer.h"
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#define FIFO_BUFFER_SIZE 65536 /* pipe capacity on Linux >= 2.6.11 */
typedef struct _FifoData {

View File

@@ -19,15 +19,10 @@
#ifdef HAVE_JACK
#include <stdlib.h>
#include <errno.h>
#include "../os_compat.h"
#include "../conf.h"
#include "../log.h"
#include <string.h>
#include <pthread.h>
#include <jack/jack.h>
#include <jack/types.h>
#include <jack/ringbuffer.h>
@@ -37,7 +32,11 @@ pthread_cond_t play_audio = PTHREAD_COND_INITIALIZER;
/*#include "dmalloc.h"*/
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#ifdef MIN
# undef MIN
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
/*#define SAMPLE_SIZE sizeof(jack_default_audio_sample_t);*/

View File

@@ -20,23 +20,13 @@
*/
#include "../audioOutput.h"
#include <stdlib.h>
#include "../os_compat.h"
#ifdef HAVE_MVP
#include "../conf.h"
#include "../log.h"
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
typedef struct {
unsigned long dsp_status;
unsigned long stream_decode_type;

View File

@@ -20,23 +20,13 @@
*/
#include "../audioOutput.h"
#include <stdlib.h>
#include "../os_compat.h"
#ifdef HAVE_OSS
#include "../conf.h"
#include "../log.h"
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#if defined(__OpenBSD__) || defined(__NetBSD__)
# include <soundcard.h>
#else /* !(defined(__OpenBSD__) || defined(__NetBSD__) */

View File

@@ -21,8 +21,6 @@
#ifdef HAVE_OSX
#include <AudioUnit/AudioUnit.h>
#include <stdlib.h>
#include <pthread.h>
#include "../log.h"
@@ -368,7 +366,5 @@ AudioOutputPlugin osxPlugin = {
#else
#include <stdio.h>
DISABLED_AUDIO_OUTPUT_PLUGIN(osxPlugin)
#endif

View File

@@ -18,15 +18,11 @@
#include "../audioOutput.h"
#include <stdlib.h>
#ifdef HAVE_PULSE
#include "../conf.h"
#include "../log.h"
#include <string.h>
#include <time.h>
#include "../os_compat.h"
#include <pulse/simple.h>
#include <pulse/error.h>

View File

@@ -18,8 +18,6 @@
#include "../audioOutput.h"
#include <stdlib.h>
#ifdef HAVE_SHOUT
#include "../conf.h"
@@ -27,9 +25,6 @@
#include "../pcm_utils.h"
#include "../timer.h"
#include <string.h>
#include <time.h>
#include <shout/shout.h>
#include <vorbis/vorbisenc.h>