nm-gvaluearray-compat.h 3.02 KB
Newer Older
1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/*
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 * 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.
 */

20 21
#ifndef __NM_GVALUEARRAY_COMPAT_H__
#define __NM_GVALUEARRAY_COMPAT_H__
22 23

#define g_value_array_get_type() \
24
  ({ \
25 26 27 28 29 30
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_get_type (); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_get_nth(value_array, index_) \
31
  ({ \
32 33 34 35 36 37
    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) \
38
  ({ \
39 40 41 42 43
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_new (n_prealloced); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

44 45 46
static inline void
__g_value_array_free (GValueArray *value_array)
{
47
	({
48 49 50 51 52 53
		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
54 55

#define g_value_array_copy(value_array) \
56
  ({ \
57 58 59 60 61 62
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_copy (value_array); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

#define g_value_array_prepend(value_array, value) \
63
  ({ \
64 65 66 67 68 69
    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) \
70
  ({ \
71 72 73 74 75 76
    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) \
77
  ({ \
78 79 80 81 82 83
    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_) \
84
  ({ \
85 86 87 88 89 90
    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) \
91
  ({ \
92 93 94 95 96 97
    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) \
98
  ({ \
99 100 101 102 103
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
    g_value_array_sort_with_data (value_array, compare_func, user_data); \
    G_GNUC_END_IGNORE_DEPRECATIONS \
  })

104
#endif  /* __NM_GVALUEARRAY_COMPAT_H__ */