GSocketInputStream/GSocketOutputStream: fix win32 build
authorDan Winship <danw@gnome.org>
Tue, 22 Nov 2011 13:56:54 +0000 (08:56 -0500)
committerDan Winship <danw@gnome.org>
Tue, 22 Nov 2011 13:56:54 +0000 (08:56 -0500)
based on a patch from Chun-wei Fan

https://bugzilla.gnome.org/show_bug.cgi?id=664455

gio/gsocketinputstream.c
gio/gsocketoutputstream.c

index e8d89fe..3736616 100644 (file)
@@ -39,13 +39,17 @@ static void g_socket_input_stream_file_descriptor_based_iface_init (GFileDescrip
 #endif
 
 #define g_socket_input_stream_get_type _g_socket_input_stream_get_type
+
+#ifdef G_OS_UNIX
 G_DEFINE_TYPE_WITH_CODE (GSocketInputStream, g_socket_input_stream, G_TYPE_INPUT_STREAM,
                         G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM, g_socket_input_stream_pollable_iface_init)
-#ifdef G_OS_UNIX
-
                         G_IMPLEMENT_INTERFACE (G_TYPE_FILE_DESCRIPTOR_BASED, g_socket_input_stream_file_descriptor_based_iface_init)
-#endif
                         )
+#else
+G_DEFINE_TYPE_WITH_CODE (GSocketInputStream, g_socket_input_stream, G_TYPE_INPUT_STREAM,
+                        G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM, g_socket_input_stream_pollable_iface_init)
+                        )
+#endif
 
 enum
 {
index 1335c4d..2320b17 100644 (file)
@@ -43,12 +43,17 @@ static void g_socket_output_stream_file_descriptor_based_iface_init (GFileDescri
 #endif
 
 #define g_socket_output_stream_get_type _g_socket_output_stream_get_type
+
+#ifdef G_OS_UNIX
 G_DEFINE_TYPE_WITH_CODE (GSocketOutputStream, g_socket_output_stream, G_TYPE_OUTPUT_STREAM,
                         G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM, g_socket_output_stream_pollable_iface_init)
-#ifdef G_OS_UNIX
                         G_IMPLEMENT_INTERFACE (G_TYPE_FILE_DESCRIPTOR_BASED, g_socket_output_stream_file_descriptor_based_iface_init)
+                        )
+#else
+G_DEFINE_TYPE_WITH_CODE (GSocketOutputStream, g_socket_output_stream, G_TYPE_OUTPUT_STREAM,
+                        G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM, g_socket_output_stream_pollable_iface_init)
+                        )
 #endif
-);
 
 enum
 {