www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: Win32 compile of example/simple/ssh2_exec.c broken

Win32 compile of example/simple/ssh2_exec.c broken

From: Guenter <lists_at_gknw.net>
Date: Thu, 02 Jul 2009 02:22:28 +0200

Hi Daniel,
can you please commit the below patch before release? I had still no
time yet to sort GIT things out :(

--- example/simple/ssh2_exec.c.orig 2009-05-30 04:02:02.000000000 +0200
+++ example/simple/ssh2_exec.c 2009-06-20 03:06:58.000000000 +0200
@@ -12,20 +12,33 @@
  *
  */

-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
+#include "libssh2_config.h"
+#include <libssh2.h>
+
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+# ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
 #include <sys/time.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <ctype.h>

-#include <libssh2.h>
-
 static int waitsocket(int socket_fd, LIBSSH2_SESSION *session)
 {
     struct timeval timeout;

GŁn.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Received on 2009-07-02

the libssh2 team