[svn] gcry - r1255 - trunk/src

svn author wk cvs at cvs.gnupg.org
Wed Jun 6 19:02:26 CEST 2007


Author: wk
Date: 2007-06-06 19:01:56 +0200 (Wed, 06 Jun 2007)
New Revision: 1255

Modified:
   trunk/src/ChangeLog
   trunk/src/gcrypt.h.in
Log:
Pth fix for W32.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2007-05-31 09:48:05 UTC (rev 1254)
+++ trunk/src/ChangeLog	2007-06-06 17:01:56 UTC (rev 1255)
@@ -1,3 +1,9 @@
+2007-06-06  Werner Koch  <wk at g10code.com>
+
+	* gcrypt.h.in (GCRY_THREAD_OPTION_PTH_IMPL): Factror network
+	related code out so that the prototypes can be adjusted for W32.
+	(_GCRY_THREAD_OPTION_PTH_IMPL_NET): New.
+
 2007-05-09  Werner Koch  <wk at g10code.com>
 
 	* libgcrypt.m4: Print found version on success.

Modified: trunk/src/gcrypt.h.in
===================================================================
--- trunk/src/gcrypt.h.in	2007-05-31 09:48:05 UTC (rev 1254)
+++ trunk/src/gcrypt.h.in	2007-06-06 17:01:56 UTC (rev 1255)
@@ -210,6 +210,36 @@
 #endif
 };
 
+#ifdef _WIN32
+# define _GCRY_THREAD_OPTION_PTH_IMPL_NET				      \
+static ssize_t gcry_pth_select (int nfd, void *rset, void *wset,	      \
+				void *eset, struct timeval *timeout)	      \
+  { return pth_select (nfd, rset, wset, eset, timeout); }		      \
+static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options)	      \
+  { return pth_waitpid (pid, status, options); }			      \
+static int gcry_pth_accept (int s, void *addr,                                \
+			    gcry_socklen_t *length_ptr)			      \
+  { return pth_accept (s, addr, length_ptr); }				      \
+static int gcry_pth_connect (int s, void *addr,		                      \
+			     gcry_socklen_t length)			      \
+  { return pth_connect (s, addr, length); }
+#else /*!_WIN32*/
+# define _GCRY_THREAD_OPTION_PTH_IMPL_NET				      \
+static ssize_t gcry_pth_select (int nfd, fd_set *rset, fd_set *wset,	      \
+				fd_set *eset, struct timeval *timeout)	      \
+  { return pth_select (nfd, rset, wset, eset, timeout); }		      \
+static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options)	      \
+  { return pth_waitpid (pid, status, options); }			      \
+static int gcry_pth_accept (int s, struct sockaddr *addr,		      \
+			    gcry_socklen_t *length_ptr)			      \
+  { return pth_accept (s, addr, length_ptr); }				      \
+static int gcry_pth_connect (int s, struct sockaddr *addr,		      \
+			     gcry_socklen_t length)			      \
+  { return pth_connect (s, addr, length); }
+#endif /*!_WIN32*/
+
+
+
 #define GCRY_THREAD_OPTION_PTH_IMPL					      \
 static int gcry_pth_init (void)						      \
 { return (pth_init () == FALSE) ? errno : 0; }				      \
@@ -246,17 +276,7 @@
   { return pth_read (fd, buf, nbytes); }				      \
 static ssize_t gcry_pth_write (int fd, const void *buf, size_t nbytes)	      \
   { return pth_write (fd, buf, nbytes); }				      \
-static ssize_t gcry_pth_select (int nfd, fd_set *rset, fd_set *wset,	      \
-				fd_set *eset, struct timeval *timeout)	      \
-  { return pth_select (nfd, rset, wset, eset, timeout); }		      \
-static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options)	      \
-  { return pth_waitpid (pid, status, options); }			      \
-static int gcry_pth_accept (int s, struct sockaddr *addr,		      \
-			    gcry_socklen_t *length_ptr)			      \
-  { return pth_accept (s, addr, length_ptr); }				      \
-static int gcry_pth_connect (int s, struct sockaddr *addr,		      \
-			     gcry_socklen_t length)			      \
-  { return pth_connect (s, addr, length); }				      \
+_GCRY_THREAD_OPTION_PTH_IMPL_NET                                              \
 									      \
 /* FIXME: GNU Pth is missing pth_sendmsg and pth_recvmsg.  */		      \
 static struct gcry_thread_cbs gcry_threads_pth = { GCRY_THREAD_OPTION_PTH,    \
@@ -265,6 +285,7 @@
   gcry_pth_select, gcry_pth_waitpid, gcry_pth_accept, gcry_pth_connect,       \
   NULL, NULL }
 
+
 #define GCRY_THREAD_OPTION_PTHREAD_IMPL					      \
 static int gcry_pthread_mutex_init (void **priv)			      \
 {									      \




More information about the Gnupg-commits mailing list