help-texinfo
[Top][All Lists]
Advanced

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

Defining convenience wrapper for @def... categories


From: Arsen Arsenović
Subject: Defining convenience wrapper for @def... categories
Date: Fri, 20 Jan 2023 21:13:13 +0100

Hi,

I'm working on the GCC manual again (finally!), and I'm trying to
harmonize it on using definition commands for built-ins et al.  For
writing convenience, as well as consistency, I'd like to define aliases
for commonly-used categories (for instance, I'd like to define a
@defbuiltin = @deftypefn {Built-in Function} ...).

I tried the obvious:

  @c Convenience macro for defining builtins, in similar spirit
  @c to @deftypefun for functions.
  @macro defbuiltin
  @deftypefn {Built-in Function}
  @end macro

  @macro defbuiltinx
  @deftypefnx {Built-in Function}
  @end macro

The above, however, is not a drop-in replacement for the fully expanded
form, since something like

  @defbuiltin {size_t} __builtin_object_size ...

... breaks, where the expanded equivalent does not; however, it does
work in some cases, such as:

  @defbuiltin @var{type} __sync_add_and_fetch (@var{type} *ptr, @
                                               @var{type} value, @
                                               ...)

This also requires that the command is terminated by @end deftypefn,
which exposes the detail of the implementation of the macro, and hence
is a bit ugly.

What's the idiomatic way to make such an alias?  Is there any currently?

Thanks in advance, have a nice day.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature


reply via email to

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