examples: Make them built on non-win32 with GLib < 2.36
authorOlivier Crête <olivier.crete@collabora.com>
Thu, 23 Apr 2015 01:26:09 +0000 (21:26 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Thu, 23 Apr 2015 01:26:09 +0000 (21:26 -0400)
examples/sdp-example.c
examples/simple-example.c
examples/threaded-example.c

index bf31c5a..342061f 100644 (file)
@@ -44,7 +44,9 @@
 
 #include <agent.h>
 
+#if GLIB_CHECK_VERSION(2, 36, 0)
 #include <gio/gnetworking.h>
+#endif
 
 static GMainLoop *gloop;
 static gchar *stun_addr = NULL;
@@ -93,10 +95,11 @@ main(int argc, char *argv[])
     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();
 #endif
-  g_networking_init();
 
   gloop = g_main_loop_new(NULL, FALSE);
 
index aa259aa..c28cbb3 100644 (file)
 #include <string.h>
 #include <ctype.h>
 
-#include <gio/gnetworking.h>
-
 #include <agent.h>
 
+#if GLIB_CHECK_VERSION(2, 36, 0)
+#include <gio/gnetworking.h>
+#endif
 
 static GMainLoop *gloop;
 static GIOChannel* io_stdin;
@@ -104,10 +105,11 @@ main(int argc, char *argv[])
     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();
 #endif
-  g_networking_init();
 
   gloop = g_main_loop_new(NULL, FALSE);
 #ifdef G_OS_WIN32
index 2564b3a..f1f2750 100644 (file)
@@ -44,7 +44,9 @@
 
 #include <agent.h>
 
+#if GLIB_CHECK_VERSION(2, 36, 0)
 #include <gio/gnetworking.h>
+#endif
 
 static GMainLoop *gloop;
 static gchar *stun_addr = NULL;
@@ -102,7 +104,9 @@ main(int argc, char *argv[])
     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();
 #endif
   g_networking_init();