Re: [Vala] Conditional compilation



On Wed, Apr 23, 2008 at 10:48:59AM +0200, Enrique Ocaña González wrote:
I'd like to do conditional compilation (use of #define, #ifdef, etc.) on my 
project just to do different things depending on the machine architecture and 
the presence of particular libraries in the system.

Some time ago, someone talked about that in the list or in the IRC, and the 
answer was to preprocess vala code with cpp by hand before using the vala 
compiler.

Hi Enrique,

This doesn't really answer your question about using cpp, but you
might be able to achieve what you want in a different way, if you are
happy with method-level conditionals.

Classes can be split across Vala files, so you could put the
architecture/library dependent methods into different Vala files and
compile different Vala files depending on the configuration.

Or, you could use the [Conditional] attribute as someone pointed out
in a previous e-mail. I pasted the answer into the FAQ:

http://live.gnome.org/Vala/FAQ

Regarding the strange output, I think they are cpp linemarkers

http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html


Rodney

Attachment: signature.asc
Description: Digital signature



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