Re: [Vala] Define constant at compile time



It is possible to use cpp as Preprocessor. I'm working on a
wrapper-program to combine cpp and give it valac to compile. The easiest
way i found actually.

best regards,
Wutzara

Am Dienstag, den 16.11.2010, 18:42 +0100 schrieb Aleksander Wabik:
Hi all,

I'm new to Vala and I'd like to have some help to solve a small but
frustrating problem. Basically, I have a Gtk.UIManager that I want to
initialize in this way:

 var ui_manager = new Gtk.UIManager();
 ui_manager.add_ui_from_file(UI_FILE);

I want to specify the constant UI_FILE at compile time, but I don't know
how to do that. In C I would write something like that:

 #ifndef UI_FILE
 #define UI_FILE "default-path.xml"
 #endif

and then I would call gcc with the option -DUI_FILE="something". I've
tried to use the -D option of the Vala compiler, but it doesn't seem to
work as I expect. Any ideas?

Many thanks,
Andrea


AFAIK it's not possible, and my humble request would be to consider
developing vala preprocessor into something useful. I want to use it
too ;)

best regards,

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list





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