From 55e128cced7b03f90d3dcccb4c01730f310245fd Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Mon, 17 Feb 2014 23:48:22 +0100
Subject: test: various fixups for building without GLib

---
 test/FakeDecoderAPI.cxx | 2 --
 test/dump_playlist.cxx  | 4 ++++
 test/dump_text_file.cxx | 4 ++++
 test/read_tags.cxx      | 4 ++++
 test/run_filter.cxx     | 4 ++++
 test/run_normalize.cxx  | 2 --
 test/run_output.cxx     | 4 ++++
 7 files changed, 20 insertions(+), 4 deletions(-)

(limited to 'test')

diff --git a/test/FakeDecoderAPI.cxx b/test/FakeDecoderAPI.cxx
index 88db4a268..4dfc545ee 100644
--- a/test/FakeDecoderAPI.cxx
+++ b/test/FakeDecoderAPI.cxx
@@ -23,8 +23,6 @@
 #include "util/Error.hxx"
 #include "Compiler.h"
 
-#include <glib.h>
-
 #include <unistd.h>
 
 void
diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx
index d8a7c4bfa..9e2e10516 100644
--- a/test/dump_playlist.cxx
+++ b/test/dump_playlist.cxx
@@ -33,7 +33,9 @@
 #include "thread/Cond.hxx"
 #include "Log.hxx"
 
+#ifdef HAVE_GLIB
 #include <glib.h>
+#endif
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -53,8 +55,10 @@ int main(int argc, char **argv)
 
 	/* initialize GLib */
 
+#ifdef HAVE_GLIB
 #if !GLIB_CHECK_VERSION(2,32,0)
 	g_thread_init(NULL);
+#endif
 #endif
 
 	/* initialize MPD */
diff --git a/test/dump_text_file.cxx b/test/dump_text_file.cxx
index e664c5a1b..a2fc10b3f 100644
--- a/test/dump_text_file.cxx
+++ b/test/dump_text_file.cxx
@@ -32,7 +32,9 @@
 #include "archive/ArchiveList.hxx"
 #endif
 
+#ifdef HAVE_GLIB
 #include <glib.h>
+#endif
 
 #include <unistd.h>
 #include <stdio.h>
@@ -79,8 +81,10 @@ int main(int argc, char **argv)
 
 	/* initialize GLib */
 
+#ifdef HAVE_GLIB
 #if !GLIB_CHECK_VERSION(2,32,0)
 	g_thread_init(NULL);
+#endif
 #endif
 
 	/* initialize MPD */
diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index 89253a78d..c525c8064 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -32,7 +32,9 @@
 #include "thread/Cond.hxx"
 #include "Log.hxx"
 
+#ifdef HAVE_GLIB
 #include <glib.h>
+#endif
 
 #include <assert.h>
 #include <unistd.h>
@@ -88,8 +90,10 @@ int main(int argc, char **argv)
 	decoder_name = argv[1];
 	const Path path = Path::FromFS(argv[2]);
 
+#ifdef HAVE_GLIB
 #if !GLIB_CHECK_VERSION(2,32,0)
 	g_thread_init(NULL);
+#endif
 #endif
 
 	io_thread_init();
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index 7816827d7..c43144a10 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -32,7 +32,9 @@
 #include "system/FatalError.hxx"
 #include "Log.hxx"
 
+#ifdef HAVE_GLIB
 #include <glib.h>
+#endif
 
 #include <assert.h>
 #include <string.h>
@@ -100,8 +102,10 @@ int main(int argc, char **argv)
 
 	/* initialize GLib */
 
+#ifdef HAVE_GLIB
 #if !GLIB_CHECK_VERSION(2,32,0)
 	g_thread_init(NULL);
+#endif
 #endif
 
 	/* read configuration file (mpd.conf) */
diff --git a/test/run_normalize.cxx b/test/run_normalize.cxx
index 300dae1d3..9a361b790 100644
--- a/test/run_normalize.cxx
+++ b/test/run_normalize.cxx
@@ -30,8 +30,6 @@
 #include "util/Error.hxx"
 #include "stdbin.h"
 
-#include <glib.h>
-
 #include <stddef.h>
 #include <stdio.h>
 #include <unistd.h>
diff --git a/test/run_output.cxx b/test/run_output.cxx
index 6a6400477..374a0ceca 100644
--- a/test/run_output.cxx
+++ b/test/run_output.cxx
@@ -37,7 +37,9 @@
 #include "util/Error.hxx"
 #include "Log.hxx"
 
+#ifdef HAVE_GLIB
 #include <glib.h>
+#endif
 
 #include <assert.h>
 #include <string.h>
@@ -176,8 +178,10 @@ int main(int argc, char **argv)
 
 	AudioFormat audio_format(44100, SampleFormat::S16, 2);
 
+#ifdef HAVE_GLIB
 #if !GLIB_CHECK_VERSION(2,32,0)
 	g_thread_init(NULL);
+#endif
 #endif
 
 	/* read configuration file (mpd.conf) */
-- 
cgit v1.2.3