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/msg01055.html below:

Re: Tree sitter support for C-like languages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Yuan Fu Subject: Re: Tree sitter support for C-like languages Date: Wed, 16 Nov 2022 09:29:42 -0800
> On Nov 16, 2022, at 5:29 AM, Po Lu <luangruo@yahoo.com> wrote:
> 
> 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.)

They are fine, missing a semicolon is no big deal. On the other hand DEFUN is 
far enough from normal C syntax.

Yuan




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