[svn] gcry - r1163 - trunk/src

svn author marcus cvs at cvs.gnupg.org
Tue Jul 4 14:54:18 CEST 2006


Author: marcus
Date: 2006-07-04 14:54:17 +0200 (Tue, 04 Jul 2006)
New Revision: 1163

Modified:
   trunk/src/ChangeLog
   trunk/src/ath.c
Log:
2006-07-04  Marcus Brinkmann  <marcus at g10code.de>

	* ath.c: Avoid warning about double defined type byte and other
	hacks to let it build for W32 (backported from LIBGCRYPT-1-2-BRANCH).


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-07-04 12:32:21 UTC (rev 1162)
+++ trunk/src/ChangeLog	2006-07-04 12:54:17 UTC (rev 1163)
@@ -1,5 +1,8 @@
 2006-07-04  Marcus Brinkmann  <marcus at g10code.de>
 
+	* ath.c: Avoid warning about double defined type byte and other
+	hacks to let it build for W32 (backported from LIBGCRYPT-1-2-BRANCH).
+
 	* gcrypt.h: Revert last change, and instead:
 	[_WIN32 || __WIN32__]: Do not include <sys/socket.h>, but
 	<winsock2.h> and <ws2tcpip.h>.

Modified: trunk/src/ath.c
===================================================================
--- trunk/src/ath.c	2006-07-04 12:32:21 UTC (rev 1162)
+++ trunk/src/ath.c	2006-07-04 12:54:17 UTC (rev 1163)
@@ -30,11 +30,14 @@
 # include <sys/time.h>
 #endif
 #include <sys/types.h>
+#ifndef _WIN32
 #include <sys/wait.h>
+#endif
 #include <errno.h>
 
 #include "ath.h"
 
+
 
 /* The interface table.  */
 static struct ath_ops ops;
@@ -227,13 +230,22 @@
 
 
 ssize_t
+#ifdef _WIN32
+ath_select (int nfd, void *rset, void *wset, void *eset,
+	    struct timeval *timeout)
+#else
 ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
 	    struct timeval *timeout)
+#endif
 {
   if (ops_set && ops.select)
     return (*ops.select) (nfd, rset, wset, eset, timeout);
   else
+#ifdef _WIN32
+    return -1;
+#else
     return select (nfd, rset, wset, eset, timeout);
+#endif
 }
 
  
@@ -243,45 +255,82 @@
   if (ops_set && ops.waitpid)
     return (*ops.waitpid) (pid, status, options);
   else
+#ifdef _WIN32
+    return -1;
+#else
     return waitpid (pid, status, options);
+#endif
 }
 
 
 int
+#ifdef _WIN32
+ath_accept (int s, void *addr, int *length_ptr)
+#else
 ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr)
+#endif
 {
   if (ops_set && ops.accept)
     return (*ops.accept) (s, addr, length_ptr);
   else
+#ifdef _WIN32
+    return -1;
+#else
     return accept (s, addr, length_ptr);
+#endif
 }
 
 
 int
+#ifdef _WIN32
+ath_connect (int s, void *addr, socklen_t length)
+#else
 ath_connect (int s, struct sockaddr *addr, socklen_t length)
+#endif
 {
   if (ops_set && ops.connect)
     return (*ops.connect) (s, addr, length);
   else
+#ifdef _WIN32
+    return -1;
+#else
     return connect (s, addr, length);
+#endif
 }
 
 
 int
+#ifdef _WIN32
+ath_sendmsg (int s, const void *msg, int flags)
+#else
 ath_sendmsg (int s, const struct msghdr *msg, int flags)
+#endif
 {
   if (ops_set && ops.sendmsg)
     return (*ops.sendmsg) (s, msg, flags);
   else
+#ifdef _WIN32
+    return -1;
+#else
     return sendmsg (s, msg, flags);
+#endif
 }
 
 
 int
+#ifdef _WIN32
+ath_recvmsg (int s, void *msg, int flags)
+#else
 ath_recvmsg (int s, struct msghdr *msg, int flags)
+#endif
 {
   if (ops_set && ops.recvmsg)
     return (*ops.recvmsg) (s, msg, flags);
   else
+#ifdef _WIN32
+    return -1;
+#else
     return recvmsg (s, msg, flags);
+#endif
 }
+




More information about the Gnupg-commits mailing list