Initial version of Xerces-c.
[fedora-mingw.git] / libssh2 / libssh2-02-libssh_priv-headers.patch
1 diff -urN libssh2-0.18.orig/configure.in libssh2-0.18.mingw/configure.in
2 --- libssh2-0.18.orig/configure.in      2007-07-31 10:55:29.000000000 +0100
3 +++ libssh2-0.18.mingw/configure.in     2008-11-10 14:12:07.000000000 +0000
4 @@ -249,6 +250,7 @@
5  AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
6  AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h])
7  AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
8 +AC_CHECK_HEADERS([windows.h ws2tcpip.h winsock2.h])
9  AC_CHECK_FUNCS(poll gettimeofday select)
10  
11  AC_FUNC_ALLOCA
12 diff -urN libssh2-0.18.orig/src/libssh2_priv.h libssh2-0.18.mingw/src/libssh2_priv.h
13 --- libssh2-0.18.orig/src/libssh2_priv.h        2007-08-10 23:30:30.000000000 +0100
14 +++ libssh2-0.18.mingw/src/libssh2_priv.h       2008-11-10 13:57:49.000000000 +0000
15 @@ -41,6 +41,14 @@
16  #define LIBSSH2_LIBRARY
17  #include "libssh2_config.h"
18  
19 +#ifdef HAVE_WINDOWS_H
20 +#include <windows.h>
21 +#endif
22 +
23 +#ifdef HAVE_WS2TCPIP_H
24 +#include <ws2tcpip.h>
25 +#endif
26 +
27  /* The following CPP block should really only be in session.c and
28     packet.c.  However, AIX have #define's for 'events' and 'revents'
29     and we are using those names in libssh2.h, so we need to include
30 @@ -70,6 +78,28 @@
31  #include "libssh2_publickey.h"
32  #include "libssh2_sftp.h"
33  
34 +/* Provide iovec / writev on WIN32 platform. */
35 +#ifdef WIN32
36 +
37 +/* same as WSABUF */
38 +struct iovec {
39 +       u_long iov_len;
40 +       char *iov_base;
41 +};
42 +
43 +#define inline __inline
44 +
45 +static inline int writev(int sock, struct iovec *iov, int nvecs)
46 +{
47 +       DWORD ret;
48 +       if (WSASend(sock, (LPWSABUF)iov, nvecs, &ret, 0, NULL, NULL) == 0) {
49 +               return ret;
50 +       }
51 +       return -1;
52 +}
53 +
54 +#endif /* WIN32 */
55 +
56  /* Needed for struct iovec on some platforms */
57  #ifdef HAVE_SYS_UIO_H
58  #include <sys/uio.h>