aboutsummaryrefslogtreecommitdiffstats
path: root/src/os_compat.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-01-03 07:29:49 +0000
committerEric Wong <normalperson@yhbt.net>2008-01-03 07:29:49 +0000
commitcb8f1af3bd5056109bfbe75faf568430a5121bda (patch)
tree86d812b051bca48fd6b4f32706d506a3d77a3989 /src/os_compat.h
parent790e70cf25ade17e7412b153c440ef4999fe72fd (diff)
downloadmpd-cb8f1af3bd5056109bfbe75faf568430a5121bda.tar.gz
mpd-cb8f1af3bd5056109bfbe75faf568430a5121bda.tar.xz
mpd-cb8f1af3bd5056109bfbe75faf568430a5121bda.zip
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
Diffstat (limited to 'src/os_compat.h')
-rw-r--r--src/os_compat.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/os_compat.h b/src/os_compat.h
new file mode 100644
index 000000000..c6268d0d8
--- /dev/null
+++ b/src/os_compat.h
@@ -0,0 +1,77 @@
+/* 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 OS_COMPAT_H
+#define OS_COMPAT_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, ...)
+ */
+
+#if defined(HAVE_STDINT_H)
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#elif defined(HAVE_SYS_INTTYPES_H)
+#include <sys/inttypes.h>
+#endif
+#include <sys/types.h>
+
+#define _XOPEN_SOURCE 600 /* for posix_fadvise, won't hurt if not available */
+#include <fcntl.h>
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <sys/param.h>
+#include <pthread.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <dirent.h>
+#include <math.h>
+#include <sys/select.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <pwd.h>
+#include <grp.h>
+#include <limits.h>
+#include <stddef.h> /* needed? this defines NULL + offsetof() */
+#include <resolv.h>
+
+/* remove when we switch to pthreads: */
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+#endif /* OS_COMPAT_H */