Re: [Vala] xmlrpc-c bindings for vala



On Sun, Sep 05, 2010 at 11:13:36 +1200, Phil Daintree wrote:
# valac --pkg xmlrpc-c xmlrpc-test.vala
xmlrpc-test.vala:18.7-18.11: error: The name `ARRAY' does not exist
in the context of `print_value'
    case ARRAY:
         ^^^^^

Vala (like C#) places enum constants in the enum type scope, not like C/C++
in the surrounding scope. So the constants need to be qualified with their
type.

I can see in your xmlrpc-c.vapi

[CCode (cname="xmlrpc_type", cprefix="XMLRPC_TYPE_")]
    public enum Type {
        INT,
        BOOL,
        DOUBLE,
        DATETIME,
        STRING,
        BASE64,
        ARRAY,
        STRUCT,
        C_PTR,
        NIL,
        I8,
        DEAD
    }

So you need to write:

    case Type.ARRAY:

or even

    case Xmlrpc.Type.ARRAY:

if the above turns out to be ambiguous (which it easily is, since "Type" is
quite generic, so it may easily end up being imported from more than one
namespace).

Dtto for the other cases, of course.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



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