[Vala] Sharing a trick to use some C macros in VALA



Dear list,

I found this trick today, in case it is not already dinosaur..

[CCode (cname="G_STRUCT_OFFSET(MyBaseClassClass, my_function)")]
extern const int MyFunctionOffset;

basically you can call in this way any c macros that are otherwise not
directly bindable to vala, given that the return type of the macro is
known.


- Yu




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