aboutsummaryrefslogtreecommitdiffstats
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-15 12:32:15 +0100
committerMax Kellermann <max@duempel.org>2013-12-15 18:43:12 +0100
commitd5dfe7d457b559bd9c53d65d0315c55611cc6a79 (patch)
tree42825c13cc44e4fe1272d14f9dc26f03ce0ef596 /src/Main.cxx
parent0db0b4e302f82165b763da7717059911a85c370f (diff)
downloadmpd-d5dfe7d457b559bd9c53d65d0315c55611cc6a79.tar.gz
mpd-d5dfe7d457b559bd9c53d65d0315c55611cc6a79.tar.xz
mpd-d5dfe7d457b559bd9c53d65d0315c55611cc6a79.zip
configure.ac: add option "--disable-glib"
Allows building without GLib. This fails to compile currently, because GLib is still used in the MPD core.
Diffstat (limited to '')
-rw-r--r--src/Main.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 2d25297c9..da8458340 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -79,7 +79,9 @@
#include "ArchiveList.hxx"
#endif
+#ifdef HAVE_GLIB
#include <glib.h>
+#endif
#include <stdlib.h>
@@ -92,6 +94,8 @@
#include <ws2tcpip.h>
#endif
+#include <limits.h>
+
static constexpr unsigned DEFAULT_BUFFER_SIZE = 4096;
static constexpr unsigned DEFAULT_BUFFER_BEFORE_PLAY = 10;
@@ -359,12 +363,14 @@ int mpd_main(int argc, char *argv[])
setlocale(LC_CTYPE,"");
#endif
+#ifdef HAVE_GLIB
g_set_application_name("Music Player Daemon");
#if !GLIB_CHECK_VERSION(2,32,0)
/* enable GLib's thread safety code */
g_thread_init(nullptr);
#endif
+#endif
winsock_init();
io_thread_init();
@@ -473,7 +479,7 @@ int mpd_main(int argc, char *argv[])
}
if (!glue_state_file_init(error)) {
- g_printerr("%s\n", error.GetMessage());
+ LogError(error);
return EXIT_FAILURE;
}