diff options
Diffstat (limited to 'include/nm-glib-compat.h')
| -rw-r--r-- | include/nm-glib-compat.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h index f9c1ae49..63d9598d 100644 --- a/include/nm-glib-compat.h +++ b/include/nm-glib-compat.h @@ -74,4 +74,13 @@ p##_get_type (void) \ } #endif +#if !GLIB_CHECK_VERSION(2,34,0) +static inline void +g_type_ensure (GType type) +{ + if (G_UNLIKELY (type == (GType)-1)) + g_error ("can't happen"); +} +#endif + #endif /* NM_GLIB_COMPAT_H */ |