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

2009-11-03 Thread Sam Liddicott
* Feng Yu wrote, On 03/11/09 00:55: import themwith Pragmas You mean that a pragma would identify that an argument took a C type? e.g. talloc_zero(void* memctx, [argtype="typesymbol"] typesymbol); Sam On Nov 2, 2009 2:03 PM, "Sam Liddicott" > wrote: To get some

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

2009-11-02 Thread Feng Yu
import themwith Pragmas On Nov 2, 2009 2:03 PM, "Sam Liddicott" wrote: To get some of these tricks to work it would be helpful to be able to pass the C type underlying the vala type as a macro parameter. I've a bug with patches that does this using typeof() to emit the C typesymbol but it does

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

2009-11-02 Thread Sam Liddicott
ith c macros is topical again, does anyone have ideas on this? Sam -Original Message- From: pancake Sent: 01 November 2009 10:29 To: Yu Feng ; vala-list@gnome.org Subject: Re: [Vala] Sharing a trick to use some C macros in VALA I was thinking few time ago to add language support to do t

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

2009-11-01 Thread pancake
I was thinking few time ago to add language support to do this from vala using the offsetof() keyword. Will someone else find interesting such a keyword in vala? Like in sizeof() I was needing it to use kernel's list.h On Nov 1, 2009, at 6:00 AM, Yu Feng wrote: Dear list, I found this tr

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

2009-10-31 Thread Yu Feng
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 ty