diff --git a/src/crypto.h b/src/crypto.h index 48068e90..2dda8e50 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -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) diff --git a/src/mbedtls.h b/src/mbedtls.h index 71a4979d..eab04a6e 100644 --- a/src/mbedtls.h +++ b/src/mbedtls.h @@ -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 #include #include @@ -58,6 +65,10 @@ #include #include +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + /* Define which features are supported. */ #define LIBSSH2_MD5 1