1
0
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` since
81d53de4dc (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 from b66d7317ca

TODO: Straighten out the use a mixture of `HAVE_WINDOWS_H`,
      `WIN32`, `_WIN32` to detect Windows.
This commit is contained in:
Viktor Szakats
2023-04-01 12:31:16 +00:00
committed by Viktor Szakats
parent ba53142e0e
commit eb236329c4
30 changed files with 29 additions and 65 deletions

View File

@ -17,8 +17,9 @@
#include <libssh2.h>
#include <libssh2_sftp.h>
#ifdef HAVE_WINSOCK2_H
#ifdef WIN32
# include <winsock2.h>
# define write(f, b, c) write((f), (b), (unsigned int)(c))
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
@ -46,10 +47,6 @@
#pragma warning(disable:4127)
#endif
#ifdef WIN32
#define write(f, b, c) write((f), (b), (unsigned int)(c))
#endif
const char *keyfile1 = "~/.ssh/id_rsa.pub";
const char *keyfile2 = "~/.ssh/id_rsa";
const char *username = "username";