summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-10-10 14:38:25 +0100
committerSimon McVittie <smcv@collabora.com>2022-10-10 14:38:25 +0100
commit5bb5b7c71ed917e55aea06171af7fb1b95dae817 (patch)
tree53a48020658123ddc7756af325402dc09ec41e7c
parent2e46d5b14592038ea74ffb292f69bc9db510f0ce (diff)
downloadlibglnx-5bb5b7c71ed917e55aea06171af7fb1b95dae817.tar.gz
backports: Backport new NONE/DEFAULT constants from GLib 2.74
These enums were not originally defined with a zero-valued constant (or in the case of GApplicationFlags, the constant always existed but its name was inappropriate for GObject-Introspection), and the corresponding constants were added in GLib 2.74 to make them more self-documenting. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--glnx-backports.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/glnx-backports.h b/glnx-backports.h
index 68ce025..184a6d1 100644
--- a/glnx-backports.h
+++ b/glnx-backports.h
@@ -94,4 +94,17 @@ gboolean glnx_set_object (GObject **object_ptr,
(((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon))
#endif
+#if !GLIB_CHECK_VERSION(2, 74, 0)
+#define G_APPLICATION_DEFAULT_FLAGS ((GApplicationFlags) 0)
+#define G_CONNECT_DEFAULT ((GConnectFlags) 0)
+#define G_IO_FLAG_NONE ((GIOFlags) 0)
+#define G_MARKUP_DEFAULT_FLAGS ((GMarkupParseFlags) 0)
+#define G_REGEX_DEFAULT ((GRegexCompileFlags) 0)
+#define G_REGEX_MATCH_DEFAULT ((GRegexMatchFlags) 0)
+#define G_TEST_SUBPROCESS_DEFAULT ((GTestSubprocessFlags) 0)
+#define G_TEST_TRAP_DEFAULT ((GTestTrapFlags) 0)
+#define G_TLS_CERTIFICATE_NO_FLAGS ((GTlsCertificateFlags) 0)
+#define G_TYPE_FLAG_NONE ((GTypeFlags) 0)
+#endif
+
G_END_DECLS