devel/rubygem-glib2: unbreak with glib 2.76

rbglib_bookmarkfile.c:39:1: error: static declaration of 'g_bookmark_file_get_type' follows non-static declaration
g_bookmark_file_get_type(void)
^
/usr/local/include/glib-2.0/gobject/glib-types.h:402:9: note: previous declaration is here
GType   g_bookmark_file_get_type   (void) G_GNUC_CONST;
        ^
rbglib_bookmarkfile.c:50:9: warning: 'G_TYPE_BOOKMARK_FILE' macro redefined [-Wmacro-redefined]
 #define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type())
         ^
/usr/local/include/glib-2.0/gobject/glib-types.h:337:9: note: previous definition is here
 #define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type ())
         ^

PR:		270087
Reported by:	antoine (via exp-run)
This commit is contained in:
Jan Beich 2023-03-16 13:20:29 +00:00
parent 4482d8ec36
commit 9a23b33ce9

View file

@ -0,0 +1,18 @@
--- ext/glib2/rbglib_bookmarkfile.c.orig 2023-03-16 13:19:47 UTC
+++ ext/glib2/rbglib_bookmarkfile.c
@@ -35,6 +35,7 @@ bookmarkfile_copy(const GBookmarkFile* file)
return (GBookmarkFile*)file;
}
+#if !GLIB_CHECK_VERSION(2, 76, 0)
static GType
g_bookmark_file_get_type(void)
{
@@ -48,6 +49,7 @@ g_bookmark_file_get_type(void)
/************************************************/
#define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type())
+#endif
#define RG_TARGET_NAMESPACE cBookmarkFile
#define _SELF(self) ((GBookmarkFile*)(RVAL2BOXED(self, G_TYPE_BOOKMARK_FILE)))