[Top][All Lists]

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

Re: Tree sitter support for C-like languages

From: Po Lu
Subject: Re: Tree sitter support for C-like languages
Date: Wed, 16 Nov 2022 21:29:04 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

> DEFUN is Emacs-specific, but the other examples I've shown aren't, I
> see them in many other programs.

Right.  What about "common" macros, such as ones that involve type

For example, here is some sample GLib code, and GLib is a library used
widely throughout GNOME and freedesktop.org:

#ifdef HAVE_GTK3
static void emacs_menu_bar_get_preferred_width (GtkWidget *, gint *, gint *);
static GType emacs_menu_bar_get_type (void);

typedef struct _EmacsMenuBar
  GtkMenuBar parent;
} EmacsMenuBar;

typedef struct _EmacsMenuBarClass
  GtkMenuBarClass parent;
} EmacsMenuBarClass;

G_DEFINE_TYPE (EmacsMenuBar, emacs_menu_bar, GTK_TYPE_MENU_BAR)

Note how the the macro has no trailing semicolon.  That is required for
it to work correctly (I don't know why.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]