changeset 946:f8e1de328ac1

Fix various compilation related issues, make includes more POSIX compliant, utilize autoconf detected stuff via conditionals as needed.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 20:32:18 +0200
parents 600964060bcc
children c98251b9b876
files configure.ac src/config.h.in src/xs_config.c src/xs_length.c src/xs_stil.c src/xs_support.c src/xs_support.h
diffstat 7 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Mon Nov 19 18:28:52 2012 +0200
+++ b/configure.ac	Mon Nov 19 20:32:18 2012 +0200
@@ -61,7 +61,7 @@
 AC_HEADER_STDC
 AC_C_INLINE
 AC_C_CONST
-AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
+AC_CHECK_HEADERS([stdlib.h string.h unistd.h stdarg.h])
 
 AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
--- a/src/config.h.in	Mon Nov 19 18:28:52 2012 +0200
+++ b/src/config.h.in	Mon Nov 19 20:32:18 2012 +0200
@@ -67,6 +67,9 @@
 /* Define if you have XMMS patched with the songpos patch. */
 #undef HAVE_SONG_POSITION
 
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
--- a/src/xs_config.c	Mon Nov 19 18:28:52 2012 +0200
+++ b/src/xs_config.c	Mon Nov 19 20:32:18 2012 +0200
@@ -51,11 +51,9 @@
 #define XS_CFG_GET_INT(q,z)     xmms_cfg_read_int(cfg, XS_CONFIG_IDENT, q, z)
 #define XS_CFG_GET_BOOL(q,z)    xmms_cfg_read_boolean(cfg, XS_CONFIG_IDENT, q, z)
 #endif
-#include <stdio.h>
-#include <ctype.h>
+#include "xs_support.h"
 #include "xs_glade.h"
 #include "xs_interface.h"
-#include "xs_support.h"
 #include "xs_backend.h"
 
 /*
@@ -322,7 +320,7 @@
 #elif defined(HAVE_SIDPLAY1)
     xs_cfg.playerEngine = XS_ENG_SIDPLAY1;
     xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING;
-#else
+#elif !defined(HAVE_SIDPLAYFP)
 #error This should not happen! No emulator engines configured in!
 #endif
 
--- a/src/xs_length.c	Mon Nov 19 18:28:52 2012 +0200
+++ b/src/xs_length.c	Mon Nov 19 20:32:18 2012 +0200
@@ -22,9 +22,6 @@
 */
 #include "xs_length.h"
 #include "xs_support.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
 
 
 /* Free memory allocated for given SLDB node
--- a/src/xs_stil.c	Mon Nov 19 18:28:52 2012 +0200
+++ b/src/xs_stil.c	Mon Nov 19 20:32:18 2012 +0200
@@ -22,10 +22,6 @@
 */
 #include "xs_stil.h"
 #include "xs_support.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <stdarg.h>
 
 
 /* Database handling functions
--- a/src/xs_support.c	Mon Nov 19 18:28:52 2012 +0200
+++ b/src/xs_support.c	Mon Nov 19 20:32:18 2012 +0200
@@ -25,12 +25,9 @@
    --
 */
 #include "xs_support.h"
-#include <stdarg.h>
-#include <ctype.h>
 #ifndef __AUDACIOUS_NEWVFS__
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #endif
 
 /* Error messages
--- a/src/xs_support.h	Mon Nov 19 18:28:52 2012 +0200
+++ b/src/xs_support.h	Mon Nov 19 20:32:18 2012 +0200
@@ -11,7 +11,16 @@
 
 #include <glib.h>
 #include <stdio.h>
+#include <ctype.h>
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #ifdef AUDACIOUS_PLUGIN
 #include <audacious/plugin.h>