]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
use new-form macros to disable -Wredundant-decls
authorNick Mathewson <nickm@torproject.org>
Tue, 14 Jun 2016 16:22:52 +0000 (12:22 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Jun 2016 16:22:52 +0000 (12:22 -0400)
src/test/test_tortls.c
src/tools/tor-gencert.c

index 52be7d4e3a0ba3d966ace46cd5739a46e1b0fea9..f8fd7affe6bf268e3109f35f6c0f9a0b20ea8bfa 100644 (file)
 #endif
 #include <math.h>
 
-#ifdef __GNUC__
-#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
-#endif
+#include "compat.h"
+
 
-#if __GNUC__ && GCC_VERSION >= 402
-#if GCC_VERSION >= 406
-#pragma GCC diagnostic push
-#endif
 /* Some versions of OpenSSL declare SSL_get_selected_srtp_profile twice in
  * srtp.h. Suppress the GCC warning so we can build with -Wredundant-decl. */
-#pragma GCC diagnostic ignored "-Wredundant-decls"
-#endif
+DISABLE_GCC_WARNING(redundant-decls)
 
 #include <openssl/opensslv.h>
 
 #include <openssl/evp.h>
 #include <openssl/bn.h>
 
-#if __GNUC__ && GCC_VERSION >= 402
-#if GCC_VERSION >= 406
-#pragma GCC diagnostic pop
-#else
-#pragma GCC diagnostic warning "-Wredundant-decls"
-#endif
-#endif
+ENABLE_GCC_WARNING(redundant-decls)
 
 #include "or.h"
 #include "torlog.h"
index 8e9aadcb186c7f566af51351ed1f5133873ff00b..4ddfbc965765bd74ce2d58c021d9f4950a23b16d 100644 (file)
 #include <unistd.h>
 #endif
 
-#ifdef __GNUC__
-#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
-#endif
+#include "compat.h"
 
-#if __GNUC__ && GCC_VERSION >= 402
-#if GCC_VERSION >= 406
-#pragma GCC diagnostic push
-#endif
 /* Some versions of OpenSSL declare X509_STORE_CTX_set_verify_cb twice in
  * x509.h and x509_vfy.h. Suppress the GCC warning so we can build with
  * -Wredundant-decl. */
-#pragma GCC diagnostic ignored "-Wredundant-decls"
-#endif
+DISABLE_GCC_WARNING(redundant-decls)
 
 #include <openssl/evp.h>
 #include <openssl/pem.h>
 #include <openssl/obj_mac.h>
 #include <openssl/err.h>
 
-#if __GNUC__ && GCC_VERSION >= 402
-#if GCC_VERSION >= 406
-#pragma GCC diagnostic pop
-#else
-#pragma GCC diagnostic warning "-Wredundant-decls"
-#endif
-#endif
+ENABLE_GCC_WARNING(redundant-decls)
 
 #include <errno.h>
 #if 0