> ----- Original Message -----
> From: Victor Aurélio Santos <victoraur.san...@gmail.com>
> Sent: Tuesday, 13 September 2016, 15:55
> Subject: Re: [Vala] LADSPA bindings
> Now...
> [CCode (cname = "connect_port", has_target = false)]
> public delegate void DescriptorConnectPort(Handle? instance, ulong
> port, ref double dataLocation);
> results in:
> src/CompressorBackend.c: In function ‘ajami_compressor_backend_connect’:
> src/CompressorBackend.c:674:2: error: unknown type name ‘connect_port’
> connect_port _tmp2_ = NULL;
I presume there's no typedef for it then. Instead try:
[CCode (lower_case_cprefix = "", has_target = false)]
public delegate void ConnectPort(Handle? instance, ulong
port, ref double dataLocation);
The lower_case_cprefix should remove the default namespace prefix
and then ConnectPort will be converted to connect_port in C.
That's my interpretation of the last paragraph of:
https://wiki.gnome.org/Projects/Vala/LegacyBindings#Delegates
If that doesn't work, I'm not sure what else to suggest. The paragraph could
mean include an empty cname, e.g.
[CCode (cname = "", has_target = false)]
public delegate void DescriptorConnectPort(Handle? instance, ulong
port, ref double dataLocation);
Use the --ccode switch with valac to get the C code produced. Look at the
code and tweak it until it works then work back to the VAPI. You can use
valac to compile C. Just use valac --pkg xyz my_c_file.c
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list