The Vala Tutorial says:
Defining new Type from other
Defining a new type is a matter of derive it from the one you need.
Here are some examples:
/* defining an alias for a basic type (equivalent to typedef int Integer in C)*/
[SimpleType]
public struct Integer : uint {
}
but when I try this, I get code that references undefined integer_dup()
and integer_free() operations.
Is this a bug in the valac code generation, or in the tutorial?
Attached is the vala source and generated C code for a test case.
It's also a bit worrisome that the C output uses both 'int32_t' and
'gint32' for the Integer type, depending on how it's used.
-m
Attachment:
typedefish.vala
Description: Text document
Attachment:
typedefish.c
Description: Text Data