From 925392c8acb3e365ee761ecd8d475f76b4eaa5b5 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 11 Aug 2014 16:29:17 +0200 Subject: [PATCH] Spotlight: call g_type_init() if glib is older then 2.36 Signed-off-by: Ralph Boehme --- etc/afpd/spotlight.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/afpd/spotlight.c b/etc/afpd/spotlight.c index f62ac6dd..5404f9f8 100644 --- a/etc/afpd/spotlight.c +++ b/etc/afpd/spotlight.c @@ -42,6 +42,8 @@ #include "directory.h" #include "etc/spotlight/sparql_parser.h" +#include + #define MAX_SL_RESULTS 20 struct slq_state_names { @@ -1285,6 +1287,9 @@ int spotlight_init(AFPObj *obj) /* * Tracker uses glibs event dispatching, so we need a mainloop */ +#if ((GLIB_MAJOR_VERSION <= 2) && (GLIB_MINOR_VERSION < 36)) + g_type_init(); +#endif sl_ctx->mainloop = g_main_loop_new(NULL, false); sl_ctx->cancellable = g_cancellable_new(); -- 2.39.2