diff --git a/clients/cli/settings.c b/clients/cli/settings.c index ea78c74504..226e6ae4d3 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -30,6 +30,7 @@ #include "utils.h" #include "common.h" #include "settings.h" +#include "nm-glib-compat.h" /* Forward declarations */ static char *wep_key_type_to_string (NMWepKeyType type); diff --git a/clients/tui/newt/nmt-newt-utils.c b/clients/tui/newt/nmt-newt-utils.c index 68d8c449e5..70a65a8489 100644 --- a/clients/tui/newt/nmt-newt-utils.c +++ b/clients/tui/newt/nmt-newt-utils.c @@ -30,6 +30,7 @@ #include +#include "nm-glib-compat.h" #include "nmt-newt-utils.h" static void diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h index 4a1e445021..698221e6b7 100644 --- a/include/nm-glib-compat.h +++ b/include/nm-glib-compat.h @@ -24,8 +24,25 @@ #include #include + +#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 + + #include "nm-gvaluearray-compat.h" + #if !GLIB_CHECK_VERSION(2,34,0) static inline void g_type_ensure (GType type) diff --git a/include/nm-gvaluearray-compat.h b/include/nm-gvaluearray-compat.h index 3e6a2fd3ed..89c028380c 100644 --- a/include/nm-gvaluearray-compat.h +++ b/include/nm-gvaluearray-compat.h @@ -22,6 +22,8 @@ #include +#include "nm-glib-compat.h" + #define g_value_array_get_type() \ G_GNUC_EXTENSION ({ \ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \