mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
nm-glib: remove G_GNUC_EXTENSION
We use statement expressions all over the place without explicitly marking them. If that would be a problem, we'd have to change a *lot* of code. We simply require that as a mandatory feature from our compiler.
This commit is contained in:
parent
45d6baac4d
commit
1b9d60f985
|
@ -21,21 +21,21 @@
|
|||
#define __NM_GVALUEARRAY_COMPAT_H__
|
||||
|
||||
#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 \
|
||||
|
@ -44,7 +44,7 @@
|
|||
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
|
||||
|
@ -53,49 +53,49 @@ __g_value_array_free (GValueArray *value_array)
|
|||
#define g_value_array_free __g_value_array_free
|
||||
|
||||
#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 \
|
||||
|
|
|
@ -313,14 +313,14 @@ _g_key_file_save_to_file (GKeyFile *key_file,
|
|||
|
||||
#if GLIB_CHECK_VERSION (2, 36, 0)
|
||||
#define g_credentials_get_unix_pid(creds, error) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
(g_credentials_get_unix_pid) ((creds), (error)); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
})
|
||||
#else
|
||||
#define g_credentials_get_unix_pid(creds, error) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
({ \
|
||||
struct ucred *native_creds; \
|
||||
\
|
||||
native_creds = g_credentials_get_native ((creds), G_CREDENTIALS_TYPE_LINUX_UCRED); \
|
||||
|
@ -357,12 +357,12 @@ _nm_g_hash_table_get_keys_as_array (GHashTable *hash_table,
|
|||
#endif
|
||||
#if !GLIB_CHECK_VERSION(2, 40, 0)
|
||||
#define g_hash_table_get_keys_as_array(hash_table, length) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
({ \
|
||||
_nm_g_hash_table_get_keys_as_array (hash_table, length); \
|
||||
})
|
||||
#else
|
||||
#define g_hash_table_get_keys_as_array(hash_table, length) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
(g_hash_table_get_keys_as_array) ((hash_table), (length)); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
|
@ -412,12 +412,12 @@ _nm_g_strv_contains (const gchar * const *strv,
|
|||
#endif
|
||||
#if !GLIB_CHECK_VERSION(2, 44, 0)
|
||||
#define g_strv_contains(strv, str) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
({ \
|
||||
_nm_g_strv_contains (strv, str); \
|
||||
})
|
||||
#else
|
||||
#define g_strv_contains(strv, str) \
|
||||
G_GNUC_EXTENSION ({ \
|
||||
({ \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
(g_strv_contains) ((strv), (str)); \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS \
|
||||
|
|
Loading…
Reference in a new issue