[libglnx/wip/smcv/2-74-constants: 6/6] backports: Backport new NONE/DEFAULT constants from GLib 2.74




commit 32e382094f19c6a69c078a23584541ad0cb18f35
Author: Simon McVittie <smcv collabora com>
Date:   Wed Jul 27 16:29:01 2022 +0100

    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>

 glnx-backports.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/glnx-backports.h b/glnx-backports.h
index 6f766a3..68e6365 100644
--- a/glnx-backports.h
+++ b/glnx-backports.h
@@ -84,6 +84,19 @@ gboolean              glnx_set_object  (GObject **object_ptr,
 #define G_OPTION_ENTRY_NULL { NULL, 0, 0, 0, NULL, NULL, NULL }
 #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
+
 #ifndef g_assert_nonnull
 #define g_assert_nonnull(x) g_assert (x != NULL)
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]