mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 21:10:32 +01:00
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 b461bf54f2)
This commit is contained in:
parent
b44f7565ec
commit
078dd82d19
4 changed files with 21 additions and 0 deletions
|
|
@ -29,6 +29,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);
|
||||
|
|
|
|||
|
|
@ -27,8 +27,25 @@
|
|||
#include <glib.h>
|
||||
#include <glib-object.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
|
||||
|
||||
|
||||
#include "nm-gvaluearray-compat.h"
|
||||
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,34,0)
|
||||
static inline void
|
||||
g_type_ensure (GType type)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#include "nm-glib-compat.h"
|
||||
|
||||
#define g_value_array_get_type() \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#include "nm-glib-compat.h"
|
||||
#include "nmt-newt-utils.h"
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue