1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-31 00:03:08 +03:00

build: add support for clang-cl, add CI job

- ci/appveyor: add clang-cl job.
- ci/appvayor: optimize setting an env.
- build: fix clang-cl builds.
- build: fix `-Wcast-function-type` compiler warnings for OpenSSL 3.
- build: use `stdint.h` with MSVC when supported.
- src: use `PRId64` for MSVC where supported.
- src: avoid recursive macro definition for `recv()` and `send()`.
- session: silence `-Wcast-function-type` for `libssh2_session_callback_set2()`.
  Sadly this function is still not fully warning-clean, and it
  seems we'd need separate setter-getters for each callback
  to avoid all warnings.

Closes #1484
This commit is contained in:
Viktor Szakats
2024-10-30 00:48:35 +01:00
parent 6443b2f9d0
commit 784446b6c5
7 changed files with 60 additions and 24 deletions

View File

@ -347,8 +347,15 @@ int main(int argc, char *argv[])
libssh2_trace(session, LIBSSH2_TRACE_CONN);
/* Set X11 Callback */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type"
#endif
libssh2_session_callback_set2(session, LIBSSH2_CALLBACK_X11,
(libssh2_cb_generic *)x11_callback);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
/* Authenticate via password */
rc = libssh2_userauth_password(session, username, password);