Re: [Vala] Does vala have a preprocessor?



On Tue, May 6, 2008 at 10:20 AM, gege2061
<gege2061 redaction-developpez com> wrote:
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?


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

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

And compilation with -DG_OS_UNIX or -DG_OS_WIN32.

Regards



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