Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-26 Thread Jürg Billeter
On Thu, 2009-03-26 at 18:13 +, Maciej Piechotka wrote: > Jürg Billeter bitron.ch> writes: > > > I understand the issue. Unfortunately, it's not easy to solve. One issue > > is that you might need multiple #if in the generated code for a single > > #if in the Vala code - e.g. for #include dire

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-26 Thread Maciej Piechotka
On Thu, 2009-03-26 at 21:18 +0100, Florian Brosch wrote: > version ( condition ) { > } > else { > } > > Such code will not be easily extended for other version of checking I'm afraid. I guess static_if would be better. > > > void my_method () { > >[StaticIf] > >if (vala.pkg.gtk+-2.0.ve

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-26 Thread Florian Brosch
version ( condition ) { } else { } > void my_method () { >    [StaticIf] >    if (vala.pkg.gtk+-2.0.version > 2.4.0") { >        // Use new gtk+ >    } else { >        // Use legacy gtk+ >    } > } > ___ Vala-list mailing list Vala-list@gnome.org http:

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-26 Thread Maciej Piechotka
Jürg Billeter bitron.ch> writes: > I understand the issue. Unfortunately, it's not easy to solve. One issue > is that you might need multiple #if in the generated code for a single > #if in the Vala code - e.g. for #include directives. It would also > require the Vala compiler to support dealing

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-24 Thread Levi Bard
> I'd like to know more about how to use C preprocessor commands in > Vala.  I know that Vala allows some sort of conditional compilation > via [Conditional], but I'm interested in a particular use case that it > doesn't seem to really help with. > > Specifically, I have a GTK+ app, and I want to u

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-24 Thread Jürg Billeter
On Mon, 2009-03-23 at 20:35 -0400, Michael Terry wrote: > I'd like to know more about how to use C preprocessor commands in > Vala. I know that Vala allows some sort of conditional compilation > via [Conditional], but I'm interested in a particular use case that it > doesn't seem to really help wi

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-24 Thread Michael Terry
On Mon, Mar 23, 2009 at 9:57 PM, Mike Massonnet wrote: > You have to run manually the source through cpp, it's a hack that > allows you to use #if's inside a Vala source. IMHO it is better to > tell on which Vala version you depend given the fact that Vala provides > Vapi files that may not work f

Re: [Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-23 Thread Mike Massonnet
Le Mon, 23 Mar 2009 20:35:43 -0400, Michael Terry a écrit : > I'd like to know more about how to use C preprocessor commands in > Vala. I know that Vala allows some sort of conditional compilation > via [Conditional], but I'm interested in a particular use case that it > doesn't seem to really h

[Vala] Conditional compilation: Passing #ifdefs through to generated C code

2009-03-23 Thread Michael Terry
I'd like to know more about how to use C preprocessor commands in Vala. I know that Vala allows some sort of conditional compilation via [Conditional], but I'm interested in a particular use case that it doesn't seem to really help with. Specifically, I have a GTK+ app, and I want to use a bit of