Re: [Vala] code does not compile with 0.13.2+, did with 0.13.1



On 5 September 2011 12:24, Luca Bruno <lethalman88 gmail com> wrote:
Put a CCode (cname = "ArgString") on top of the ArgString definition if
that's what you expect in the C code.

[I didn't write the bindings for this library, so maybe I'm missing
something important. Also I don't have much experience with writing
bindings.]

This does not work as ArgString is a helper struct defined in
liberipc.vapi, it doesn't exist in the library.
In fact this ArgString struct simulated an internal union in the
parent struct arg_t (or struct Arg in vala).

C/H:
typedef struct {
  int type;
  int data_len;
  union {
    int b;
    char by;
    int i;
    unsigned int u;
    double d;
    char *s;
    void *data;
  } value;
} eripc_arg_t;


VALA:
public struct ArgString {
    public char *s;
}

[CCode (cname = "eripc_arg_t")]
public struct Arg {
    public int type;
    public int data_len;
    public ArgString value;
}


It looks 0.13.1 allows defining new types in .vapi files but 0.13.3 does not.
Is this correct?


Thanks again,
Iñigo



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