summaryrefslogtreecommitdiff
path: root/src/test/test_tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-10-02 15:57:33 +0200
committerNick Mathewson <nickm@torproject.org>2015-10-02 15:57:33 +0200
commit0ead9a58b989887235a62511b0c664307d1226b6 (patch)
tree51b6f50eac85773e1eb9b79c6ce0bc9b7a02acb8 /src/test/test_tortls.c
parent5d5d26ccee4c67d4bb7593af42c537d7e85c1c2d (diff)
downloadtor-0ead9a58b989887235a62511b0c664307d1226b6.tar.gz
tor-0ead9a58b989887235a62511b0c664307d1226b6.zip
Avoid warnings in tortls.h includes
Diffstat (limited to 'src/test/test_tortls.c')
-rw-r--r--src/test/test_tortls.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index de900bed96..67b645c1ca 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -5,19 +5,41 @@
#define LOG_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "torlog.h"
-#include "config.h"
-#include "tortls.h"
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
-#include "test.h"
-#include "log_test_helpers.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
+
+#include <openssl/opensslv.h>
#include <openssl/ssl.h>
#include <openssl/ssl3.h>
#include <openssl/err.h>
#include <openssl/asn1t.h>
+#if __GNUC__ && GCC_VERSION >= 402
+#if GCC_VERSION >= 406
+#pragma GCC diagnostic pop
+#else
+#pragma GCC diagnostic warning "-Wredundant-decls"
+#endif
+#endif
+
+#include "or.h"
+#include "torlog.h"
+#include "config.h"
+#include "tortls.h"
+
+#include "test.h"
+#include "log_test_helpers.h"
#define NS_MODULE tortls
extern tor_tls_context_t *server_tls_context;