[CCode type = "const guint8*")] is not being respected
If I have a C function
void
asd (const guint8 *asd)
{
g_print ("Hi\n");
}
And I bind it to my Vala code like this
extern void asd ([CCode (type = "const guint8*")] uint8[]? asd);
void main () {
asd (null);
}
valac
will generate the following (bad) C code
void asd (guint8* asd);
static void _vala_main (void);
static void
_vala_main (void)
{
asd ((const guint8*) NULL);
}
Note that it declares the asd
parameter as guint8*
, and then passes a const guint8*
to it.
The expected code was
void asd (const guint8* asd);
static void _vala_main (void);
static void
_vala_main (void)
{
asd (NULL);
}