mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
delete redundant HAVE_WINSOCK2_H
`libssh2.h` required `winsock2.h` for `_WIN32` since81d53de4dc
(2011-06-04). Apply that to the whole codebase. This makes it unnecessary to detect `HAVE_WINSOCK2_H` and allows to drop all its uses. Completes TODO fromb66d7317ca
TODO: Straighten out the use a mixture of `HAVE_WINDOWS_H`, `WIN32`, `_WIN32` to detect Windows.
This commit is contained in:
committed by
Viktor Szakats
parent
ba53142e0e
commit
eb236329c4
@ -130,7 +130,6 @@ check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
|
|||||||
check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H)
|
check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H)
|
||||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||||
check_include_files(sys/un.h HAVE_SYS_UN_H)
|
check_include_files(sys/un.h HAVE_SYS_UN_H)
|
||||||
check_include_files(winsock2.h HAVE_WINSOCK2_H)
|
|
||||||
|
|
||||||
# for example and tests
|
# for example and tests
|
||||||
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
|
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
|
||||||
|
@ -218,13 +218,7 @@ dnl the code was bad, try a different program now, test 3
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#else
|
|
||||||
#ifdef HAVE_WINSOCK_H
|
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
],[
|
],[
|
||||||
/* ioctlsocket source code */
|
/* ioctlsocket source code */
|
||||||
|
@ -289,7 +289,7 @@ case $host in
|
|||||||
# These are POSIX-like systems using BSD-like sockets API.
|
# These are POSIX-like systems using BSD-like sockets API.
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_CHECK_HEADERS([windows.h winsock2.h])
|
AC_CHECK_HEADERS([windows.h])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ dnl Check for select() into ws2_32 for Msys/Mingw
|
|||||||
if test "$ac_cv_func_select" != "yes"; then
|
if test "$ac_cv_func_select" != "yes"; then
|
||||||
AC_MSG_CHECKING([for select in ws2_32])
|
AC_MSG_CHECKING([for select in ws2_32])
|
||||||
AC_TRY_LINK([
|
AC_TRY_LINK([
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINDOWS_H
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
|
@ -11,8 +11,9 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
|
# define write(f, b, c) write((f), (b), (unsigned int)(c))
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
@ -36,10 +37,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define write(f, b, c) write((f), (b), (unsigned int)(c))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
uint32_t hostaddr;
|
uint32_t hostaddr;
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
|
# define write(f, b, c) write((f), (b), (unsigned int)(c))
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
@ -44,10 +45,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define write(f, b, c) write((f), (b), (unsigned int)(c))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETTIMEOFDAY
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
/* diff in ms */
|
/* diff in ms */
|
||||||
static long tvdiff(struct timeval newer, struct timeval older)
|
static long tvdiff(struct timeval newer, struct timeval older)
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,8 +17,9 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
|
# define write(f, b, c) write((f), (b), (unsigned int)(c))
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
@ -46,10 +47,6 @@
|
|||||||
#pragma warning(disable:4127)
|
#pragma warning(disable:4127)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define write(f, b, c) write((f), (b), (unsigned int)(c))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *keyfile1 = "~/.ssh/id_rsa.pub";
|
const char *keyfile1 = "~/.ssh/id_rsa.pub";
|
||||||
const char *keyfile2 = "~/.ssh/id_rsa";
|
const char *keyfile2 = "~/.ssh/id_rsa";
|
||||||
const char *username = "username";
|
const char *username = "username";
|
||||||
|
@ -11,8 +11,9 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
|
# define write(f, b, c) write((f), (b), (unsigned int)(c))
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
@ -43,10 +44,6 @@
|
|||||||
#pragma warning(disable:4127)
|
#pragma warning(disable:4127)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define write(f, b, c) write((f), (b), (unsigned int)(c))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STORAGE "/tmp/sftp-storage" /* this is the local file name this
|
#define STORAGE "/tmp/sftp-storage" /* this is the local file name this
|
||||||
example uses to store the downloaded
|
example uses to store the downloaded
|
||||||
file in */
|
file in */
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,8 +17,9 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
|
# define write(f, b, c) write((f), (b), (unsigned int)(c))
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
@ -49,10 +50,6 @@
|
|||||||
#pragma warning(disable:4127)
|
#pragma warning(disable:4127)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define write(f, b, c) write((f), (b), (unsigned int)(c))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETTIMEOFDAY
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
/* diff in ms */
|
/* diff in ms */
|
||||||
static long tvdiff(struct timeval newer, struct timeval older)
|
static long tvdiff(struct timeval newer, struct timeval older)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
#include <libssh2_sftp.h>
|
#include <libssh2_sftp.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
#include <libssh2.h>
|
#include <libssh2.h>
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -134,9 +134,6 @@
|
|||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#define HAVE_UNISTD_H 1
|
#define HAVE_UNISTD_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <winsock2.h> header file. */
|
|
||||||
#undef HAVE_WINSOCK2_H
|
|
||||||
|
|
||||||
/* to make a symbol visible */
|
/* to make a symbol visible */
|
||||||
#undef LIBSSH2_API
|
#undef LIBSSH2_API
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#cmakedefine HAVE_SYS_IOCTL_H
|
#cmakedefine HAVE_SYS_IOCTL_H
|
||||||
#cmakedefine HAVE_SYS_TIME_H
|
#cmakedefine HAVE_SYS_TIME_H
|
||||||
#cmakedefine HAVE_SYS_UN_H
|
#cmakedefine HAVE_SYS_UN_H
|
||||||
#cmakedefine HAVE_WINSOCK2_H
|
|
||||||
|
|
||||||
/* for example and tests */
|
/* for example and tests */
|
||||||
#cmakedefine HAVE_SYS_PARAM_H
|
#cmakedefine HAVE_SYS_PARAM_H
|
||||||
|
@ -76,9 +76,7 @@
|
|||||||
# define LIBSSH2_WINDOWS_APP
|
# define LIBSSH2_WINDOWS_APP
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif /* WIN32 */
|
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
/* Force parameter type. */
|
/* Force parameter type. */
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#include "openssh_fixture.h"
|
#include "openssh_fixture.h"
|
||||||
#include "libssh2_config.h"
|
#include "libssh2_config.h"
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
@ -429,7 +429,7 @@ static char *running_container_id = NULL;
|
|||||||
int start_openssh_fixture(void)
|
int start_openssh_fixture(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef WIN32
|
||||||
WSADATA wsadata;
|
WSADATA wsadata;
|
||||||
|
|
||||||
ret = WSAStartup(MAKEWORD(2, 0), &wsadata);
|
ret = WSAStartup(MAKEWORD(2, 0), &wsadata);
|
||||||
|
@ -47,15 +47,14 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <winsock2.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#define getcwd _getcwd
|
#define getcwd _getcwd
|
||||||
#define chdir _chdir
|
#define chdir _chdir
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
#include <winsock2.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HAVE_LIBCRYPT32
|
#define HAVE_LIBCRYPT32
|
||||||
#define HAVE_WINSOCK2_H
|
|
||||||
#define HAVE_STDLIB_H
|
#define HAVE_STDLIB_H
|
||||||
#define HAVE_IOCTLSOCKET
|
#define HAVE_IOCTLSOCKET
|
||||||
#define HAVE_SELECT
|
#define HAVE_SELECT
|
||||||
|
Reference in New Issue
Block a user