1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-03 22:13:11 +03:00

mbedtls: further improve disabling -Wredundant-decls

Move warning option suppression to `src/mbedtls.h` to surround the actual
external header #includes that need it.

Follow-up to ecec68a2c1 #1226
Follow-up to 7ecc309cd1 #1224

Tested via #1257
This commit is contained in:
Viktor Szakats
2023-11-30 23:54:58 +00:00
parent 8d69e63db9
commit 4be5e33ae1
2 changed files with 11 additions and 9 deletions

View File

@@ -46,16 +46,7 @@
#elif defined(LIBSSH2_LIBGCRYPT)
#include "libgcrypt.h"
#elif defined(LIBSSH2_MBEDTLS)
/* mbedTLS (as of v3.5.1) has a duplicate function declaration
in its own public headers. Disable the warning that detects it. */
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
#include "mbedtls.h"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#elif defined(LIBSSH2_OS400QC3)
#include "os400qc3.h"
#elif defined(LIBSSH2_WINCNG)

View File

@@ -41,6 +41,13 @@
#define LIBSSH2_CRYPTO_ENGINE libssh2_mbedtls
/* mbedTLS (as of v3.5.1) has a duplicate function declaration
in its own public headers. Disable the warning that detects it. */
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
#include <mbedtls/version.h>
#include <mbedtls/platform.h>
#include <mbedtls/md.h>
@@ -58,6 +65,10 @@
#include <mbedtls/pk.h>
#include <mbedtls/error.h>
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
/* Define which features are supported. */
#define LIBSSH2_MD5 1