This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: `Cpp: 'ICOM_FN(##xfn)' generates a warning :-(
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: `Cpp: 'ICOM_FN(##xfn)' generates a warning :-(
- From: Francois Gouget <fgouget at free dot fr>
- Date: Wed, 3 Jan 2001 15:51:57 -0800 (PST)
- cc: gcc at gcc dot gnu dot org
On 3 Jan 2001, Alexandre Oliva wrote:
> On Jan 3, 2001, Francois Gouget <fgouget@free.fr> wrote:
>
> > Is there any other way I could avoid the prescan?
>
> Neil suggested using a varargs macro argument, introduced in C99 and
> supported by CVS GCC.
>
> #define DECLARE2(xfn,...) void ICOM_FN(xfn ## __VA_ARGS__) (void)
>
> One solution that appears to work with old and new version of GCC is:
>
> #define DECLARE2(xfn,rest...) void ICOM_FN(xfn ## rest) (void)
>
> But the use of the ISO C99-compliant solution is encouraged.
Ah! I did not think about it that way. That works.
I'm not overly enthusisatic about using vararg macros though. The
problem is it's hard to make them work across compilers (not that Wine's
code is extremely protable to start with but we try still).
Oh well, we'll duplicate the definitions. It's not that bad.
Thanks a lot for your help!
--
Francois Gouget fgouget@free.fr http://fgouget.free.fr/
Avoid the Gates of Hell - use Linux.