Submit version 0.20.1 of GUPnP (4186015)
[profile/ivi/GUPnP.git] / tests / test-introspection.c
index 8a3fbbb..1b25e5d 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
+#include <glib.h>
 
 GMainLoop *main_loop;
 
@@ -235,7 +236,9 @@ main (int argc, char **argv)
         GUPnPContext *context;
         GUPnPControlPoint *cp;
         GOptionContext *option_context;
+#ifndef G_OS_WIN32
         struct sigaction sig_action;
+#endif /* G_OS_WIN32 */
 
         option_context = g_option_context_new ("- test GUPnP introspection");
         g_option_context_add_main_entries (option_context,
@@ -253,7 +256,9 @@ main (int argc, char **argv)
                 return EXIT_FAILURE;
         }
                
+#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
+#endif
 
         error = NULL;
         context = g_initable_new (GUPNP_TYPE_CONTEXT, NULL, &error, NULL);
@@ -282,9 +287,13 @@ main (int argc, char **argv)
         main_loop = g_main_loop_new (NULL, FALSE);
 
         /* Hook the handler for SIGTERM */
+#ifndef G_OS_WIN32
         memset (&sig_action, 0, sizeof (sig_action));
         sig_action.sa_handler = interrupt_signal_handler;
         sigaction (SIGINT, &sig_action, NULL);
+#else
+        signal(SIGINT,interrupt_signal_handler);
+#endif /* G_OS_WIN32 */
 
         g_main_loop_run (main_loop);
         g_main_loop_unref (main_loop);