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>
This commit is contained in:
Simon McVittie
2022-10-10 14:38:25 +01:00
parent 2e46d5b145
commit 5bb5b7c71e

View File

@@ -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