Re: [Vala] Bug in vala compiler ? Add NULL argument to an extern function



Hi,
                             في ن، 31-05-2010 عند 13:50 +0000 ، كتب Séb:
Hello, I've got a compilation problem with vala during the generation of 
the C code.

In the C code, vala add a new argument in an extern function :

What does the NULL here ? It seems a bug in the compiler but maybe I'm 
wrong in the delegate declaration…
The NULL here is the instance pointer, it's null because you passed a
static method. if your delegate isn't passed with a "user data"
parameter, it should be annotated with [CCode (has_target=false)].

and the vapi : libftw.vapi
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = 
"ftw.h")]
namespace FTW {

    [CCode (cname = "__ftw_func_t")]
should be:
     [CCode (cname = "__ftw_func_t", has_target=false)]
    public delegate int ftw_func_t(char* name, int* status, int type);

HTH,
Abderrahim




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]