Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #384236

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

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Help requested with P99-based macro to create Wayland listeners
Date 2024-04-09 09:22 -0700
Organization A noiseless patient Spider
Message-ID <86ttka1p61.fsf@linuxsc.com> (permalink)
References <pan$3770d$7f0531e6$76520fa1$2c09330e@invalid.invalid>

Show all headers | View raw


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?

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-09 00:36 +0000
  Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-09 09:22 -0700
    Re: Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-09 18:17 +0000
      Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-09 21:59 +0200
        Re: Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-09 20:20 +0000
          Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 11:05 +0200
            Re: Help requested with P99-based macro to create Wayland listeners scott@slp53.sl.home (Scott Lurndal) - 2024-04-10 14:26 +0000
              Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 16:54 +0200
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 11:44 -0700
                Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 21:29 +0200
                Re: Help requested with P99-based macro to create Wayland listeners bart <bc@freeuk.com> - 2024-04-10 20:39 +0100
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 13:55 -0700
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 13:40 -0700
                Re: Help requested with P99-based macro to create Wayland listeners "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-04-10 13:48 -0700
            Re: Help requested with P99-based macro to create Wayland listeners Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-04-10 15:49 +0100
              Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 09:08 -0700
                Re: Help requested with P99-based macro to create Wayland listeners David Brown <david.brown@hesbynett.no> - 2024-04-10 18:40 +0200
          Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 09:03 -0700
  Re: Help requested with P99-based macro to create Wayland listeners James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-04-10 02:49 -0400
    Re: Help requested with P99-based macro to create Wayland listeners Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-04-10 13:57 +0000
    Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 09:05 -0700
    Re: Help requested with P99-based macro to create Wayland listeners Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-04-11 00:57 +0000
  Re: Help requested with P99-based macro to create Wayland listeners Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-04-10 19:56 -0700

csiph-web