Make the code compatible with older glib versions 28/22428/3
authorDariusz Michaluk <d.michaluk@samsung.com>
Tue, 3 Jun 2014 09:54:17 +0000 (11:54 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 3 Jun 2014 11:07:04 +0000 (13:07 +0200)
[Bug/Feature]   Make the code compatible with older glib versions.
[Cause]         N/A
[Solution]      Specific define for older glib versions.
[Verification]  Built and run tests.

Change-Id: I65a16393fe3c266ca1b27bea166b1d2b2a41d0be
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
common/utils/glib-loop.cpp

index 6a60778..a735e1e 100644 (file)
@@ -26,6 +26,7 @@
 #include "utils/glib-loop.hpp"
 #include "utils/callback-wrapper.hpp"
 
+#include <glib-object.h>
 
 namespace security_containers {
 namespace utils {
@@ -34,6 +35,9 @@ namespace utils {
 ScopedGlibLoop::ScopedGlibLoop()
     : mLoop(g_main_loop_new(NULL, FALSE), g_main_loop_unref)
 {
+#if !GLIB_CHECK_VERSION(2,36,0)
+    g_type_init();
+#endif
     mLoopThread = std::thread([this] {
                                   g_main_loop_run(mLoop.get());
                               });