[network-manager-applet/th/bgo739246_clang: 5/10] all: add compatibility macros to ignore deprecation warnings for clang
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/th/bgo739246_clang: 5/10] all: add compatibility macros to ignore deprecation warnings for clang
- Date: Mon, 27 Oct 2014 14:50:39 +0000 (UTC)
commit 5bd86c9199b588cd718d3c4e53bea703455a12ad
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>
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 b442a67..b43879b 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 2ac949e..2adb270 100644
--- a/src/utils/nm-glib-compat.h
+++ b/src/utils/nm-glib-compat.h
@@ -25,6 +25,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]