ORBit2 r2062 - in trunk/linc2: . src



Author: tml
Date: Mon May 19 21:28:14 2008
New Revision: 2062
URL: http://svn.gnome.org/viewvc/ORBit2?rev=2062&view=rev

Log:
2008-05-20  Tor Lillqvist  <tml novell com>

	Bug 524056 - Patch: fix linc2 so it compiles with MSVC.
	
	* src/linc-connection.c
	* src/linc-source.c
	* src/linc-compat.h: Patch by Marcelo Vanzin. Add a few ifdefs.



Modified:
   trunk/linc2/ChangeLog
   trunk/linc2/src/linc-compat.h
   trunk/linc2/src/linc-connection.c
   trunk/linc2/src/linc-source.c

Modified: trunk/linc2/src/linc-compat.h
==============================================================================
--- trunk/linc2/src/linc-compat.h	(original)
+++ trunk/linc2/src/linc-compat.h	Mon May 19 21:28:14 2008
@@ -39,7 +39,9 @@
 #endif
 
 #include <sys/stat.h>
-#include <sys/time.h>
+#ifdef HAVE_SYS_TIME_H
+#  include <sys/time.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif

Modified: trunk/linc2/src/linc-connection.c
==============================================================================
--- trunk/linc2/src/linc-connection.c	(original)
+++ trunk/linc2/src/linc-connection.c	Mon May 19 21:28:14 2008
@@ -888,8 +888,10 @@
 		}
 	} while (len > 0 && block_for_full_read);
 
+#ifdef CONNECTION_DEBUG
 	d_printf ("we read %d bytes (total %"G_GUINT64_FORMAT")\n",
 		  bytes_read, cnx->priv->total_read_bytes);
+#endif
 
  out:
 	CNX_UNLOCK (cnx);
@@ -987,11 +989,12 @@
 								qw->vecs,
 								MIN (qw->nvecs, LINK_IOV_MAX)), n);
 #endif
+#ifdef CONNECTION_DEBUG
 		d_printf ("wrote %d bytes (total %"G_GUINT64_FORMAT")\n",
 			  n,
 			  (cnx->priv->total_written_bytes += ((n > 0) ? n : 0),
 			   cnx->priv->total_written_bytes));
-
+#endif
 		if (n < 0) {
 #ifdef LINK_SSL_SUPPORT
 			if (cnx->options & LINK_CONNECTION_SSL) {

Modified: trunk/linc2/src/linc-source.c
==============================================================================
--- trunk/linc2/src/linc-source.c	(original)
+++ trunk/linc2/src/linc-source.c	Mon May 19 21:28:14 2008
@@ -9,6 +9,7 @@
  * Copyright 1998, 2001, 2005, Red Hat, Inc., Ximian, Inc., Novell, Inc.
  */
 
+#include <config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
@@ -81,8 +82,10 @@
 	}
 
 	if (watch->event_mask != event_mask) {
+#ifdef CONNECTION_DEBUG
 		d_printf ("prepare: WSAEventSelect(%d, %#x, {%s})\n",
 			  watch->socket, watch->pollfd.fd, fd_mask (event_mask));
+#endif
 		if (WSAEventSelect (watch->socket, (HANDLE) watch->pollfd.fd,
 				    event_mask) == SOCKET_ERROR)
 			d_printf ("WSAEventSelect() failed: %s\n",
@@ -115,7 +118,9 @@
 		d_printf ("\nWSAEnumNetworkEvents failed: %s\n",
 			  link_strerror (WSAGetLastError ()));
 	else {
+#ifdef CONNECTION_DEBUG
 		d_printf ("events={%s}\n", fd_mask (events.lNetworkEvents));
+#endif
 		if (watch->pollfd.revents != 0 &&
 		    events.lNetworkEvents == 0) {
 			watch->event_mask = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]