Commit 414f9e4a authored by Olivier Crête's avatar Olivier Crête

examples: Make them built on non-win32 with GLib < 2.36

parent d36a42f1
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
#include <agent.h> #include <agent.h>
#if GLIB_CHECK_VERSION(2, 36, 0)
#include <gio/gnetworking.h> #include <gio/gnetworking.h>
#endif
static GMainLoop *gloop; static GMainLoop *gloop;
static gchar *stun_addr = NULL; static gchar *stun_addr = NULL;
...@@ -93,10 +95,11 @@ main(int argc, char *argv[]) ...@@ -93,10 +95,11 @@ main(int argc, char *argv[])
g_debug("Using stun server '[%s]:%u'\n", stun_addr, stun_port); g_debug("Using stun server '[%s]:%u'\n", stun_addr, stun_port);
} }
#if !GLIB_CHECK_VERSION(2, 36, 0) #if GLIB_CHECK_VERSION(2, 36, 0)
g_networking_init();
#else
g_type_init(); g_type_init();
#endif #endif
g_networking_init();
gloop = g_main_loop_new(NULL, FALSE); gloop = g_main_loop_new(NULL, FALSE);
......
...@@ -42,10 +42,11 @@ ...@@ -42,10 +42,11 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <gio/gnetworking.h>
#include <agent.h> #include <agent.h>
#if GLIB_CHECK_VERSION(2, 36, 0)
#include <gio/gnetworking.h>
#endif
static GMainLoop *gloop; static GMainLoop *gloop;
static GIOChannel* io_stdin; static GIOChannel* io_stdin;
...@@ -104,10 +105,11 @@ main(int argc, char *argv[]) ...@@ -104,10 +105,11 @@ main(int argc, char *argv[])
g_debug("Using stun server '[%s]:%u'\n", stun_addr, stun_port); g_debug("Using stun server '[%s]:%u'\n", stun_addr, stun_port);
} }
#if !GLIB_CHECK_VERSION(2, 36, 0) #if GLIB_CHECK_VERSION(2, 36, 0)
g_networking_init();
#else
g_type_init(); g_type_init();
#endif #endif
g_networking_init();
gloop = g_main_loop_new(NULL, FALSE); gloop = g_main_loop_new(NULL, FALSE);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
......
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
#include <agent.h> #include <agent.h>
#if GLIB_CHECK_VERSION(2, 36, 0)
#include <gio/gnetworking.h> #include <gio/gnetworking.h>
#endif
static GMainLoop *gloop; static GMainLoop *gloop;
static gchar *stun_addr = NULL; static gchar *stun_addr = NULL;
...@@ -102,7 +104,9 @@ main(int argc, char *argv[]) ...@@ -102,7 +104,9 @@ main(int argc, char *argv[])
g_debug("Using stun server '[%s]:%u'\n", stun_addr, stun_port); g_debug("Using stun server '[%s]:%u'\n", stun_addr, stun_port);
} }
#if !GLIB_CHECK_VERSION(2, 36, 0) #if GLIB_CHECK_VERSION(2, 36, 0)
g_networking_init();
#else
g_type_init(); g_type_init();
#endif #endif
g_networking_init(); g_networking_init();
......
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