Re: Help requested with P99-based macro to create Wayland listeners

Liste des GroupesRevenir à l c 
Sujet : Re: Help requested with P99-based macro to create Wayland listeners
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.c
Date : 10. Apr 2024, 08:49:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uv5cov$q401$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 4/8/24 20:36, Blue-Maned_Hawk wrote:
This macro doesn't work and i don't know why.  I've tried multiple
different things to try to delay the expansion of _0MAKE_LISTENER and none
of them have worked.  I don't know if there's a more idiomatic way to do
this.  I've tried looking at the output from putting it through ‘cpp’ and
that didn't work because it errored out before i could see what it
expanded to.
 
#define MAKE_LISTENER(object_type, ...) static const struct\
object_type##_listener object_type##_listener = { P99_SEQ(\

This isn't a C problem, or at least,not entirely a C problem. I'd
thought that the P99 in your subject line might be a typo for C99, but I
have no idea what P99_SEQ is. Wikipedia knows 9 different meanings for
P99. Google gives me way too many hits from P99, I have no idea which
one is relevant. You might need to take this up with someone who has
some idea what P99 is.

The basic technique for delaying expansion is as follows:

#define STR(e) #e
#define STRSTR(e) STR(e)

and then replace WHATEVER with STRSTR(WHATEVER).

There are, I understand, good reasons based upon how macro expansion
works why this solution is necessary, but even when I was a lot younger
I had trouble understanding those reasons. I generally had to rely upon
trial and error to figure out the right way to use STRSTR().

Date Sujet#  Auteur
9 Apr 24 * Help requested with P99-based macro to create Wayland listeners22Blue-Maned_Hawk
9 Apr 24 +* Re: Help requested with P99-based macro to create Wayland listeners16Tim Rentsch
9 Apr 24 i`* Re: Help requested with P99-based macro to create Wayland listeners15Blue-Maned_Hawk
9 Apr 24 i `* Re: Help requested with P99-based macro to create Wayland listeners14David Brown
9 Apr 24 i  `* Re: Help requested with P99-based macro to create Wayland listeners13Blue-Maned_Hawk
10 Apr 24 i   +* Re: Help requested with P99-based macro to create Wayland listeners11David Brown
10 Apr 24 i   i+* Re: Help requested with P99-based macro to create Wayland listeners3Ben Bacarisse
10 Apr 24 i   ii`* Re: Help requested with P99-based macro to create Wayland listeners2Tim Rentsch
10 Apr 24 i   ii `- Re: Help requested with P99-based macro to create Wayland listeners1David Brown
10 Apr 24 i   i`* Re: Help requested with P99-based macro to create Wayland listeners7David Brown
10 Apr 24 i   i `* Re: Help requested with P99-based macro to create Wayland listeners6Chris M. Thomasson
10 Apr 24 i   i  `* Re: Help requested with P99-based macro to create Wayland listeners5David Brown
10 Apr 24 i   i   +* Re: Help requested with P99-based macro to create Wayland listeners2bart
10 Apr 24 i   i   i`- Re: Help requested with P99-based macro to create Wayland listeners1Chris M. Thomasson
10 Apr 24 i   i   `* Re: Help requested with P99-based macro to create Wayland listeners2Chris M. Thomasson
10 Apr 24 i   i    `- Re: Help requested with P99-based macro to create Wayland listeners1Chris M. Thomasson
10 Apr 24 i   `- Re: Help requested with P99-based macro to create Wayland listeners1Tim Rentsch
10 Apr 24 +* Re: Help requested with P99-based macro to create Wayland listeners4James Kuyper
10 Apr 24 i+- Re: Help requested with P99-based macro to create Wayland listeners1Blue-Maned_Hawk
10 Apr 24 i+- Re: Help requested with P99-based macro to create Wayland listeners1Tim Rentsch
11 Apr 24 i`- Re: Help requested with P99-based macro to create Wayland listeners1Lawrence D'Oliveiro
11 Apr 24 `- Re: Help requested with P99-based macro to create Wayland listeners1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal