diff options
| author | Michael Biebl <biebl@debian.org> | 2016-03-01 16:56:10 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-03-01 16:56:10 +0100 |
| commit | e62b307a9dd108e664aa507355ed3dd15a9c6d67 (patch) | |
| tree | 2957d1a0dde11be8bd9f506f8b075d21b85da2d0 /shared/nm-glib.h | |
| parent | de39787fedbff438bd933c30675fc5c026db6aa0 (diff) | |
| parent | c2de0d98ba39e0a1a970d066fd19be786092f376 (diff) | |
Merge tag 'upstream/1.1.91'
Upstream version 1.1.91
Diffstat (limited to 'shared/nm-glib.h')
| -rw-r--r-- | shared/nm-glib.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/shared/nm-glib.h b/shared/nm-glib.h index c75e91ba..c92d6f0f 100644 --- a/shared/nm-glib.h +++ b/shared/nm-glib.h @@ -116,6 +116,20 @@ __g_type_ensure (GType type) #define g_test_initialized() (g_test_config_vars->test_initialized) #endif +/* g_assert_cmpmem() is only available since glib 2.46. */ +#if !GLIB_CHECK_VERSION (2, 45, 7) +#define g_assert_cmpmem(m1, l1, m2, l2) G_STMT_START {\ + gconstpointer __m1 = m1, __m2 = m2; \ + int __l1 = l1, __l2 = l2; \ + if (__l1 != __l2) \ + g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + #l1 " (len(" #m1 ")) == " #l2 " (len(" #m2 "))", __l1, "==", __l2, 'i'); \ + else if (memcmp (__m1, __m2, __l1) != 0) \ + g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + "assertion failed (" #m1 " == " #m2 ")"); \ + } G_STMT_END +#endif + /* Rumtime check for glib version. First do a compile time check which * (if satisfied) shortcuts the runtime check. */ #define nm_glib_check_version(major, minor, micro) \ @@ -353,4 +367,11 @@ _nm_g_hash_table_get_keys_as_array (GHashTable *hash_table, }) #endif +#ifndef g_info +/* g_info was only added with 2.39.2 */ +#define g_info(...) g_log (G_LOG_DOMAIN, \ + G_LOG_LEVEL_INFO, \ + __VA_ARGS__) +#endif + #endif /* __NM_GLIB_H__ */ |