From: Viktor Szakats Date: Tue, 20 Aug 2024 13:07:38 +0000 (+0200) Subject: ssh: deduplicate SSH backend includes (and fix libssh cmake unity build) X-Git-Tag: curl-8_10_0~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac207bf567779f9002a43f921767cc41f5b68317;p=thirdparty%2Fcurl.git ssh: deduplicate SSH backend includes (and fix libssh cmake unity build) For libssh, it fixes a "unity" build issue where libssh deprecation warnings were not suppressed before this patch, because the suppression macro was only set before just one of the two `libssh.h` includes. If the other was compiled first in unity mode, the warnings appeared. Seen in local curl-for-win build (`CW_CONFIG=test-x64-libssh-quictls`) with libssh 0.11.0. (Also in a GHA/macos cmake job upcoming in #14614) Use this opportunity to drop duplicate SSH header includes from the SSH modules. It's enough to include them via the common `ssh.h` header. Closes #14612 --- diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 120e8f8d51..dcf26fe409 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -31,11 +31,6 @@ #include -/* in 0.10.0 or later, ignore deprecated warnings */ -#define SSH_SUPPRESS_DEPRECATED -#include -#include - #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index abf987bf5f..b9b64555ad 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -30,9 +30,6 @@ #include -#include -#include - #ifdef HAVE_FCNTL_H #include #endif diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 64ef332988..2ed78649b9 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -30,6 +30,8 @@ #include #include #elif defined(USE_LIBSSH) +/* in 0.10.0 or later, ignore deprecated warnings */ +#define SSH_SUPPRESS_DEPRECATED #include #include #elif defined(USE_WOLFSSH) diff --git a/lib/vssh/wolfssh.c b/lib/vssh/wolfssh.c index 9f723964d8..fab65d0db4 100644 --- a/lib/vssh/wolfssh.c +++ b/lib/vssh/wolfssh.c @@ -28,8 +28,6 @@ #include -#include -#include #include "urldata.h" #include "cfilters.h" #include "connect.h"