[network-manager-applet/nma-0-9-10: 5/15] all: add compatibility macros to ignore deprecation warnings for clang



commit 6b017a6a467d406f4378ca07180c6a201097da37
Author: Thomas Haller <thaller redhat com>
Date:   Mon Oct 27 15:12:42 2014 +0100

    all: add compatibility macros to ignore deprecation warnings for clang
    
    For clang, the defines G_GNUC_BEGIN_IGNORE_DEPRECATIONS and
    G_GNUC_END_IGNORE_DEPRECATIONS are not working. Redefine them
    for clang in our glib compatibility wrapper.
    
    Signed-off-by: Thomas Haller <thaller redhat com>
    (cherry picked from commit e119e741cd5e549f5bb1ad65260a618de972dc09)

 src/connection-editor/page-mobile.c |    1 +
 src/utils/nm-glib-compat.h          |   17 +++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index 5742426..a741508 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -27,6 +27,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
+#include <nm-glib-compat.h>
 #include <nm-setting-connection.h>
 #include <nm-setting-gsm.h>
 #include <nm-setting-cdma.h>
diff --git a/src/utils/nm-glib-compat.h b/src/utils/nm-glib-compat.h
index 997c932..d88d0ff 100644
--- a/src/utils/nm-glib-compat.h
+++ b/src/utils/nm-glib-compat.h
@@ -24,6 +24,23 @@
 #include <glib.h>
 
 
+/*************************************************************/
+
+#ifdef __clang__
+
+#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#undef G_GNUC_END_IGNORE_DEPRECATIONS
+
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+    _Pragma("clang diagnostic push") \
+    _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
+
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+    _Pragma("clang diagnostic pop")
+
+#endif
+
+
 /*************************************************************
  * undeprecate GValueArray
  *************************************************************/


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