mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-26 10:58:53 +02:00
Allow both union and struct to be boxed or not
* girepository/girnode.c: Allow gtype_name and gtype_init in struct and union. * girepository/girparser.c: Parse glib: boxed bits for both structure and union. * girepository/gtypelib.c: Don't barf if structure is boxed. * giscanner/girparser.py: Parse new XML format. * giscanner/girwriter.py: Write out new XML format. * giscanner/glibast.py: Define new classes which are both Boxed and Struct/Union, as well as an "Other" for everything else. * giscanner/glibtransformer.py: Handle boxed types specially; we try to merge them with a struct/union if one exists, otherwise fall back to generic boxed. * tests/*: Update. * tools/generate.c: Write out new format. svn path=/trunk/; revision=575
This commit is contained in:
12
gtypelib.c
12
gtypelib.c
@@ -1173,23 +1173,13 @@ validate_struct_blob (ValidateContext *ctx,
|
||||
"Wrong blob type");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((blob->blob_type == BLOB_TYPE_BOXED && blob->unregistered) ||
|
||||
(blob->blob_type == BLOB_TYPE_STRUCT && !blob->unregistered))
|
||||
{
|
||||
g_set_error (error,
|
||||
G_TYPELIB_ERROR,
|
||||
G_TYPELIB_ERROR_INVALID_BLOB,
|
||||
"Registration/blob type mismatch");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!validate_name (typelib, "struct", typelib->data, blob->name, error))
|
||||
return FALSE;
|
||||
|
||||
push_context (ctx, get_string_nofail (typelib, blob->name));
|
||||
|
||||
if (blob_type == BLOB_TYPE_BOXED)
|
||||
if (!blob->unregistered)
|
||||
{
|
||||
if (!validate_name (typelib, "boxed", typelib->data, blob->gtype_name, error))
|
||||
return FALSE;
|
||||
|
Reference in New Issue
Block a user