[Vala] preprocessor rules



In vala 0.7 we have some preprocessor rules '#if','#else','#endif'...But looks that it can only work with
variables, so if i do:

#if 0
 commented code
#else
 code that will be compiled
#endif

works, because it handles 0 as a variable and it is not defined, so the conditional will not match,
but if you do:

#if 1
 XXX: This will not be done
#else

#endif

This is a bit confusing, because there's no #define directive, only -D can be used which I understand because is a way to avoid messing around multiple definitions of variables and ugly problems can appear
if people use it in the wrong way.

I find preprocessing rules quite useful for commenting code, because they can "comment" /* */ comments.

Are there plans to support numeric values in preprocessing conditionals?

--pancake



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