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 toecec68a2c1#1226 Follow-up to7ecc309cd1#1224 Tested via #1257
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user