Index: gtype.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gtype.c,v
retrieving revision 1.70
diff -u -p -r1.70 gtype.c
--- gtype.c	2 Oct 2003 05:41:04 -0000	1.70
+++ gtype.c	30 Oct 2003 23:21:02 -0000
@@ -3568,3 +3568,41 @@ g_type_instance_get_private (GTypeInstan
 
   return G_STRUCT_MEMBER_P (instance, offset);
 }
+
+typedef struct _RegisterOnceData RegisterOnceData;
+
+struct _RegisterOnceData
+{
+  GType            parent_type;
+  const gchar     *type_name;
+  const GTypeInfo *info;
+  GTypeFlags       flags;  
+};
+
+static gpointer 
+register_once (RegisterOnceData *data)
+{
+  return GINT_TO_POINTER (g_type_register_static (data->parent_type,
+						  data->type_name,
+						  data->info,
+						  data->flags));
+}
+
+GType
+g_type_register_once (GType            parent_type,
+		      const gchar     *type_name,
+		      const GTypeInfo *info,
+		      GTypeFlags       flags,
+		      GOnce            *once)
+{
+  RegisterOnceData data;
+  gpointer result;
+  
+  data.parent_type = parent_type;
+  data.type_name = type_name;
+  data.info = info;
+  data.flags = flags;
+
+  result = g_once (once, (GThreadFunc)register_once, &data);
+  return GPOINTER_TO_INT (result);
+}
