Re: [Vala] Does vala have a preprocessor?



Hello,

I would like use this feature, but this code doesn't work:

public class Hack
{
  [Conditional (condition=define (G_OS_WIN32))]
  [CCode (cheader_filename = "gdk/gdkwin32.h", cname = "GDK_WINDOW_HWND")]
  public static uint32 get_handle (Gdk.Drawable drawable);

  [Conditional (condition=define (G_OS_UNIX))]
  [CCode (cheader_filename = "gdk/gdkx.h", cname = "GDK_WINDOW_XWINDOW")]
  public static uint32 get_handle (Gdk.Drawable drawable);
}

What is syntax of condition?

2008/4/6 Maciej Piechotka <uzytkownik2 gmail com>:
"Jaap A. Haitsma" <jaap haitsma org> writes:

 > Hi,
 >
 > Depending on which libraries are present I'd like to compile different
 > code. Is this already in vala? If not is it planned?
 >
 > Thanks
 >
 > Jaap

 As far as I remember:

 [Conditional (condition=<here-insert-condition>)]
 public int test () {
  return 0;
 }

 Regards
 --
 I've probably left my head... somewhere. Please wait untill I find it.
 Homepage (pl_PL): http://uzytkownik.jogger.pl/
 (GNU/)Linux User: #425935 (see http://counter.li.org/)



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




-- 
Nicolas Joseph

Responsable de la rubrique GTK+ de developpez.com

http://nicolasj.developpez.com



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