First set of changes for windows
[cascardo/gnio.git] / test / test-stuff.c
index 0972fad..9ccfc3c 100644 (file)
@@ -5,6 +5,8 @@
 #include <glib.h>
 #include <glib/gprintf.h>
 
+#include <winsock2.h>
+
 GMainLoop *loop;
 
 void print_address (GInetAddress *address, gpointer data);
@@ -51,11 +53,17 @@ int main (int argc, char *argv[])
        GInetAddress *address;
        GResolver *resolver;
        GError *error = NULL;
+       WSADATA wsaData;
 
-       loop = g_main_loop_new (NULL, FALSE);
+       g_thread_init (NULL);
 
        g_type_init ();
 
+       if (WSAStartup (MAKEWORD (2, 2), &wsaData) != 0)
+               return 0;
+
+       loop = g_main_loop_new (NULL, FALSE);
+
        address = (GInetAddress *) g_inet4_address_from_string ("127.0.0.1");
 
        g_printf ("%s:\n", g_inet4_address_to_string (G_INET4_ADDRESS (address)));