2013-02-24 13:01:08 +01:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
2014-07-04 13:33:18 -04:00
|
|
|
/*
|
2013-02-24 13:01:08 +01:00
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).
Fix this by changing the include guards in the non-API-stable parts of
the tree:
- libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H
- libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__
- src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__
And likewise for all other headers.
The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-13 14:10:11 -04:00
|
|
|
#ifndef __NM_GVALUEARRAY_COMPAT_H__
|
|
|
|
|
#define __NM_GVALUEARRAY_COMPAT_H__
|
2013-02-24 13:01:08 +01:00
|
|
|
|
|
|
|
|
#define g_value_array_get_type() \
|
|
|
|
|
G_GNUC_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
|
|
|
|
g_value_array_new (n_prealloced); \
|
|
|
|
|
G_GNUC_END_IGNORE_DEPRECATIONS \
|
|
|
|
|
})
|
|
|
|
|
|
2013-10-22 12:31:59 +02:00
|
|
|
static inline void
|
|
|
|
|
__g_value_array_free (GValueArray *value_array)
|
|
|
|
|
{
|
|
|
|
|
G_GNUC_EXTENSION ({
|
|
|
|
|
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
|
2013-02-24 13:01:08 +01:00
|
|
|
|
|
|
|
|
#define g_value_array_copy(value_array) \
|
|
|
|
|
G_GNUC_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
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_EXTENSION ({ \
|
|
|
|
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
|
|
|
|
g_value_array_sort_with_data (value_array, compare_func, user_data); \
|
|
|
|
|
G_GNUC_END_IGNORE_DEPRECATIONS \
|
|
|
|
|
})
|
|
|
|
|
|
all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).
Fix this by changing the include guards in the non-API-stable parts of
the tree:
- libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H
- libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__
- src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__
And likewise for all other headers.
The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-13 14:10:11 -04:00
|
|
|
#endif /* __NM_GVALUEARRAY_COMPAT_H__ */
|