[Vala] constructor/destructor in vala



Is there a way to specify the constructor/destructor compiler-dependant
function decorators?

I know that this is pretty specific, but I'm just curious about if this is
planned to be supported by the language.

In the same way it is possible to specify or identify which kind of compiler
is being used by valac?

Here's an example of the constructor stuff

static void foo() __attribute__ ((constructor));

this function must be static and will be called before main(). It's all about glibc, but all the OS have a thing like that. And it can be useful to run code before
and after main().

Something like this?

[(CCode constructor="true"))

Will be better to just keep Vala simpler and not add this feature?

--pancake



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