[glib-networking/fix-meson-assert: 1/2] Use pragma diagnostic push/pop outside of the function



commit de87c63e604c89079f225237e769644e60b317f9
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Thu Sep 26 16:31:47 2019 +0200

    Use pragma diagnostic push/pop outside of the function
    
    Fixes compilation on centos 6

 tls/openssl/gtlsconnection-openssl.c | 16 +++++++++-------
 tls/tests/connection.c               | 16 +++++++++-------
 2 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index f07be5a..8b255ba 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -224,6 +224,11 @@ end_openssl_io (GTlsConnectionOpenssl  *openssl,
     status = end_openssl_io (openssl, direction, ret, timeout == -1, err, errmsg, error_str); \
   } while (status == G_TLS_CONNECTION_BASE_TRY_AGAIN);
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 static GTlsConnectionBaseStatus
 g_tls_connection_openssl_handshake_thread_request_rehandshake (GTlsConnectionBase  *tls,
                                                                gint64               timeout,
@@ -245,14 +250,7 @@ g_tls_connection_openssl_handshake_thread_request_rehandshake (GTlsConnectionBas
 
   openssl = G_TLS_CONNECTION_OPENSSL (tls);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
   rehandshake_mode = g_tls_connection_get_rehandshake_mode (G_TLS_CONNECTION (tls));
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
   if (rehandshake_mode == G_TLS_REHANDSHAKE_NEVER)
     {
@@ -271,6 +269,10 @@ g_tls_connection_openssl_handshake_thread_request_rehandshake (GTlsConnectionBas
   return status;
 }
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
 static GTlsCertificate *
 g_tls_connection_openssl_retrieve_peer_certificate (GTlsConnectionBase *tls)
 {
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 680f48c..e61018f 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -2039,6 +2039,11 @@ quit_on_handshake_complete (GObject      *object,
   return;
 }
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 static void
 test_fallback (TestConnection *test,
                gconstpointer   data)
@@ -2060,15 +2065,8 @@ test_fallback (TestConnection *test,
 
   g_tls_client_connection_set_validation_flags (G_TLS_CLIENT_CONNECTION (test->client_connection),
                                                 0);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
   g_tls_client_connection_set_use_ssl3 (G_TLS_CLIENT_CONNECTION (test->client_connection),
                                         TRUE);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
   g_tls_connection_handshake_async (tlsconn, G_PRIORITY_DEFAULT, NULL,
                                     quit_on_handshake_complete, test);
@@ -2083,6 +2081,10 @@ test_fallback (TestConnection *test,
   g_assert_no_error (error);
 }
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
 static void
 handshake_completed (GObject      *object,
                      GAsyncResult *result,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]