test: various fixups for building without GLib

This commit is contained in:
Max Kellermann 2014-02-17 23:48:22 +01:00
parent 13056af8b2
commit 55e128cced
7 changed files with 20 additions and 4 deletions

View File

@ -23,8 +23,6 @@
#include "util/Error.hxx" #include "util/Error.hxx"
#include "Compiler.h" #include "Compiler.h"
#include <glib.h>
#include <unistd.h> #include <unistd.h>
void void

View File

@ -33,7 +33,9 @@
#include "thread/Cond.hxx" #include "thread/Cond.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
@ -53,8 +55,10 @@ int main(int argc, char **argv)
/* initialize GLib */ /* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0) #if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL); g_thread_init(NULL);
#endif
#endif #endif
/* initialize MPD */ /* initialize MPD */

View File

@ -32,7 +32,9 @@
#include "archive/ArchiveList.hxx" #include "archive/ArchiveList.hxx"
#endif #endif
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
@ -79,8 +81,10 @@ int main(int argc, char **argv)
/* initialize GLib */ /* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0) #if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL); g_thread_init(NULL);
#endif
#endif #endif
/* initialize MPD */ /* initialize MPD */

View File

@ -32,7 +32,9 @@
#include "thread/Cond.hxx" #include "thread/Cond.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
@ -88,8 +90,10 @@ int main(int argc, char **argv)
decoder_name = argv[1]; decoder_name = argv[1];
const Path path = Path::FromFS(argv[2]); const Path path = Path::FromFS(argv[2]);
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0) #if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL); g_thread_init(NULL);
#endif
#endif #endif
io_thread_init(); io_thread_init();

View File

@ -32,7 +32,9 @@
#include "system/FatalError.hxx" #include "system/FatalError.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@ -100,8 +102,10 @@ int main(int argc, char **argv)
/* initialize GLib */ /* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0) #if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL); g_thread_init(NULL);
#endif
#endif #endif
/* read configuration file (mpd.conf) */ /* read configuration file (mpd.conf) */

View File

@ -30,8 +30,6 @@
#include "util/Error.hxx" #include "util/Error.hxx"
#include "stdbin.h" #include "stdbin.h"
#include <glib.h>
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -37,7 +37,9 @@
#include "util/Error.hxx" #include "util/Error.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@ -176,8 +178,10 @@ int main(int argc, char **argv)
AudioFormat audio_format(44100, SampleFormat::S16, 2); AudioFormat audio_format(44100, SampleFormat::S16, 2);
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0) #if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL); g_thread_init(NULL);
#endif
#endif #endif
/* read configuration file (mpd.conf) */ /* read configuration file (mpd.conf) */