From f456b70013b3dd4650ca18d2456477305120df78 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Thu, 3 Jun 2010 00:56:48 -0400 Subject: [PATCH] Relocate roken WinSock declarations --- lib/roken/roken.h.in | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 219b08775..01e457897 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -316,6 +316,32 @@ rk_vsnprintf (char *str, size_t sz, const char *format, va_list args); #endif /* _MSC_VER */ +#ifdef HAVE_WINSOCK + +/* While we are at it, define WinSock specific scatter gather socket + I/O. */ + +#define iovec _WSABUF +#define iov_base buf +#define iov_len len + +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + size_t msg_iovlen; + void *msg_control; + socklen_t msg_controllen; + int msg_flags; +}; + +#define sendmsg sendmsg_w32 + +ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL +sendmsg_w32(rk_socket_t s, const struct msghdr * msg, int flags); + +#endif /* HAVE_WINSOCK */ + #ifndef HAVE_PUTENV #define putenv rk_putenv ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL putenv(const char *); @@ -825,32 +851,6 @@ ROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL gai_strerror(int); #endif -#ifdef HAVE_WINSOCK - -/* While we are at it, define WinSock specific scatter gather socket - I/O. */ - -#define iovec _WSABUF -#define iov_base buf -#define iov_len len - -struct msghdr { - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - size_t msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -#define sendmsg sendmsg_w32 - -ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL -sendmsg_w32(rk_socket_t s, const struct msghdr * msg, int flags); - -#endif - #ifdef NO_SLEEP ROKEN_LIB_FUNCTION unsigned int ROKEN_LIB_CALL -- 2.11.4.GIT