summary refs log tree commit diff
path: root/include/nm-glib-compat.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2015-12-24 00:24:58 +0100
committerMichael Biebl <biebl@debian.org>2015-12-24 00:24:58 +0100
commit54f6333410ffd570e62717d9e77c5c987175e397 (patch)
treed0698cc29d0f53c0b6d2c68d35ee2e9d72153948 /include/nm-glib-compat.h
parenta6ece1a2aa19a6268335c87d4fdef20123dd04a5 (diff)
Imported Upstream version 1.0.10 upstream/1.0.10
Diffstat (limited to 'include/nm-glib-compat.h')
-rw-r--r--include/nm-glib-compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h
index dc39d2b9..691f9935 100644
--- a/include/nm-glib-compat.h
+++ b/include/nm-glib-compat.h
@@ -111,6 +111,17 @@ __g_type_ensure (GType type)
 #define g_test_initialized() (g_test_config_vars->test_initialized)
 #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) \
+    (   GLIB_CHECK_VERSION ((major), (minor), (micro)) \
+     || (   (   glib_major_version > (major)) \
+         || (   glib_major_version == (major) \
+             && glib_minor_version > (minor)) \
+         || (   glib_major_version == (major) \
+             && glib_minor_version == (minor) \
+             && glib_micro_version >= (micro))))
+
 /* g_test_skip() is only available since glib 2.38. Add a compatibility wrapper. */
 inline static void
 __nmtst_g_test_skip (const gchar *msg)