Commit 6cf1acfb authored by Max Kellermann's avatar Max Kellermann

test/DumpDatabase, ...: no g_thread_init() calls when GLib is disabled

parent a7b09d3d
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
#include "event/Loop.hxx" #include "event/Loop.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <iostream> #include <iostream>
using std::cout; using std::cout;
...@@ -107,9 +109,11 @@ main(int argc, char **argv) ...@@ -107,9 +109,11 @@ 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(nullptr); g_thread_init(nullptr);
#endif #endif
#endif
/* initialize MPD */ /* initialize MPD */
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,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>
...@@ -50,9 +52,11 @@ int main(int argc, gcc_unused char **argv) ...@@ -50,9 +52,11 @@ int main(int argc, gcc_unused char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#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
EventLoop event_loop; EventLoop event_loop;
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h> #include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -57,9 +59,11 @@ main(int argc, char **argv) ...@@ -57,9 +59,11 @@ 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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment