A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01019.html below:

Re: Tree sitter support for C-like languages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] 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
names?

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)
#endif

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4