[Vala] C# conditional attributes in vala?



Hi,

I have certain methods that I'd only like to be linked-in under certain circumstance (for performance 
reasons).  A real world example might be a need to log messages only from debug builds.

In C or C++, I could achieve this with a macro that would evaluate to a blank line when the appropriate flag 
is not set.

In C#, I could use conditional attributes to achieve the same result.

It's my understanding that there are no plans to ever add C style macros to Vala.  I was wondering if there 
were any plans to support C# conditional attributes in vala.  And if not, is there a way for me to advocate 
for the inclusion of Conditional Attributes into Vala?

In the mean time, it seems my only option is the rather inelegant solution of peppering my code with 
#if-#endif blocks.  If there is a vala solution, I am open to suggestions.

-Nigel



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