Subject: Re: merge of freebsd eventhandler
To: None <tech-kern@netbsd.org>
From: Chapman Flack <nblists@anastigmatix.net>
List: tech-kern
Date: 05/26/2006 12:13:45
Brett Lymn wrote:
> On Fri, May 26, 2006 at 08:22:03PM +0900, YAMAMOTO Takashi wrote:
>>i don't think this vararg trick is a good idea... 
> 
> you just can pass the extra arguments in.  The only downside is you
> must be careful to match the number of arguments with what the

I kind of like it. It gives a clean syntax to use, and because these
are cpp varargs, (a) there isn't a runtime penalty, and (b) matching
the number of arguments should really not be an issue, because the
type of ((struct eventhandler_entry_##name *)t)->eh_func will be known
to the compiler, and checked; it can be different for each 'name'.
This strikes me as a very smart use of cpp.

You will, however, have to conditionally define these macros for the
source to build on vax. It's the only port still using gcc 2.95.3,
and it does support vararg macros, only with a leetle different syntax.

-Chap