[Vala] typeinfo of non-existent enum in vapi file



Hello,

The sqlite3.vapi file defines the Sqlite.Action enum, which does not
really exist in the Sqlite souce code, so executing the following fails:

Type t = typeof(Sqlite.Action);
EnumClass k = (EnumClass)t.class_ref(); // doesn't get this far

The compiler error message is:

error: ‘SQLITE3_TYPE_ACTION’ undeclared (first use in this function)

Is there a way to create a vapi file so that Sqlite.Action would not be
considered an external define and instead considered a native Vala
declaration?

Instead of this:

        [CCode (cname = "int", cprefix = "SQLITE_")]
        public enum Action {
                CREATE_INDEX,
                CREATE_TABLE,
                ...

Something like this:

        [CCode (cname = ""]
        public enum Action {
                [CCode (cname = "constant int", cprefix = "SQLITE_")]
                CREATE_INDEX,
                [CCode (cname = "constant int", cprefix = "SQLITE_")]
                CREATE_TABLE,
                ...

Kind Regards,

Tom


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