summaryrefslogtreecommitdiff
path: root/libnm-util/nm-gvaluearray-compat.h
blob: 91f4f243a67d0174288cf8ca0b5d1b92e5809cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Copyright 2013 Red Hat, Inc.
 */

#ifndef __NM_GVALUEARRAY_COMPAT_H__
#define __NM_GVALUEARRAY_COMPAT_H__

#define g_value_array_get_type() \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_get_type (); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_get_nth(value_array, index_) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_get_nth (value_array, index_); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_new(n_prealloced) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_new (n_prealloced); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

static inline void
__g_value_array_free (GValueArray *value_array)
{
	({
		G_GNUC_BEGIN_IGNORE_DEPRECATIONS
		g_value_array_free (value_array);
		G_GNUC_END_IGNORE_DEPRECATIONS
	});
}
#define g_value_array_free __g_value_array_free

#define g_value_array_copy(value_array) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_copy (value_array); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_prepend(value_array, value) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_prepend (value_array, value); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_append(value_array, value) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_append (value_array, value); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_insert(value_array, index_, value) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_insert (value_array, index_, value); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_remove(value_array, index_) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_remove (value_array, index_); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_sort(value_array, compare_func) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_sort (value_array, compare_func); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_sort_with_data(value_array, compare_func, user_data) \
  ({ \
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_sort_with_data (value_array, compare_func, user_data); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#endif  /* __NM_GVALUEARRAY_COMPAT_H__ */