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

Liste des GroupesRevenir à cl c  
Sujet : Re: Help requested with P99-based macro to create Wayland listeners
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c
Date : 09. Apr 2024, 18:22:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86ttka1p61.fsf@linuxsc.com>
References : 1
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> writes:

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(\
_0MAKE_LISTENER, P99_SEQ((object_type), __VA_ARGS__)) }
#define _0MAKE_LISTENER(x) _1MAKE_LISTENER (x, _2MAKE_LISTENER
#define _1MAKE_LISTENER _3MAKE_LISTENER
#define _2MAKE_LISTENER(y) y)
#define _3MAKE_LISTENER _4MAKE_LISTENER
#define _4MAKE_LISTENER(object_type, event_name) .event_name =\
callback_##object_type##_##event_name

What is it that you want to accomplish?

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