diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h index 9292f3699d..09f96ef6ba 100644 --- a/shared/nm-glib-aux/nm-macros-internal.h +++ b/shared/nm-glib-aux/nm-macros-internal.h @@ -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) {