+2006-04-21 Matthias Clasen <mclasen@redhat.com>
+
+ * gobject.symbols:
+ * gtype.[hc]: Add a g_type_register_static_simple
+ variant of g_type_register_static that does not take
+ a relocation-causing GTypeInfo struct, and use it
+ in G_DEFINE_TYPE.
+
2006-03-07 Matthias Clasen <mclasen@redhat.com>
* === Released 2.10.1 ===
return NODE_TYPE (node);
}
+GType
+g_type_register_static_simple (GType parent_type,
+ const gchar *type_name,
+ guint class_size,
+ GClassInitFunc class_init,
+ guint instance_size,
+ GInstanceInitFunc instance_init,
+ GTypeFlags flags)
+{
+ GTypeInfo info;
+
+ info.class_size = class_size;
+ info.base_init = NULL;
+ info.base_finalize = NULL;
+ info.class_init = class_init;
+ info.class_finalize = NULL;
+ info.class_data = NULL;
+ info.instance_size = instance_size;
+ info.n_preallocs = 0;
+ info.instance_init = instance_init;
+ info.value_table = NULL;
+
+ g_type_register_static (parent_type, type_name, &info, flags);
+}
+
GType
g_type_register_static (GType parent_type,
const gchar *type_name,
const gchar *type_name,
const GTypeInfo *info,
GTypeFlags flags);
+GType g_type_register_static_simple (GType parent_type,
+ const gchar *type_name,
+ guint class_size,
+ GClassInitFunc class_init,
+ guint instance_size,
+ GInstanceInitFunc instance_init,
+ GTypeFlags flags);
+
GType g_type_register_dynamic (GType parent_type,
const gchar *type_name,
GTypePlugin *plugin,
static GType g_define_type_id = 0; \
if (G_UNLIKELY (g_define_type_id == 0)) \
{ \
- static const GTypeInfo g_define_type_info = { \
- sizeof (TypeName##Class), \
- (GBaseInitFunc) NULL, \
- (GBaseFinalizeFunc) NULL, \
- (GClassInitFunc) type_name##_class_intern_init, \
- (GClassFinalizeFunc) NULL, \
- NULL, /* class_data */ \
- sizeof (TypeName), \
- 0, /* n_preallocs */ \
- (GInstanceInitFunc) type_name##_init, \
- NULL /* value_table */ \
- }; \
- g_define_type_id = g_type_register_static (TYPE_PARENT, g_intern_static_string (#TypeName), &g_define_type_info, (GTypeFlags) flags); \
+ g_define_type_id = \
+ g_type_register_static_simple (TYPE_PARENT, \
+ g_intern_static_string (#TypeName), \
+ sizeof (TypeName##Class), \
+ type_name##_class_intern_init, \
+ sizeof (TypeName), \
+ type_name##_init, \
+ (GTypeFlags) flags); \
{ CODE ; } \
} \
return g_define_type_id; \