mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 13:20:08 +01:00
shared: add NM_G_VARIANT_TYPE() macro
Like G_VARIANT_TYPE(), but this one can be used to initialize a static variable.
This commit is contained in:
parent
dce1aa87c2
commit
df6714102c
1 changed files with 8 additions and 0 deletions
|
|
@ -1262,6 +1262,14 @@ nm_clear_g_cancellable_disconnect (GCancellable *cancellable, gulong *cancellabl
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* GVariantType is basically a C string. But G_VARIANT_TYPE() is not suitable
|
||||
* to initialize a static variable (because it evaluates a function check that
|
||||
* the string is valid). Add an alternative macro that does the plain cast.
|
||||
*
|
||||
* Here you loose the assertion check that G_VARIANT_TYPE() to ensure the
|
||||
* string is valid. */
|
||||
#define NM_G_VARIANT_TYPE(fmt) ((const GVariantType *) (""fmt""))
|
||||
|
||||
static inline GVariant *
|
||||
nm_g_variant_ref (GVariant *v)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue