mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-28 09:50:39 +01:00
glib-aux: add nm_g_bytes_ref() helper
g_bytes_ref() does not accept NULL. But doing so can be convenient,
add a helper for that.
Note that g_bytes_unref() does accept NULL, so there is no corresponding
helper.
(cherry picked from commit 222f404928)
This commit is contained in:
parent
fa4fcf6142
commit
01bcde8ab0
1 changed files with 10 additions and 0 deletions
|
|
@ -623,6 +623,16 @@ nm_utils_is_separator(const char c)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline GBytes *
|
||||
nm_g_bytes_ref(GBytes *b)
|
||||
{
|
||||
if (b)
|
||||
g_bytes_ref(b);
|
||||
return b;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
GBytes *nm_g_bytes_get_empty(void);
|
||||
|
||||
GBytes *nm_g_bytes_new_from_str(const char *str);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue