[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] GCC question



Peter Slegg wrote:

> On Tue, 16 Nov 2010 15:56:36 , xavier.joubert@free.fr wrote:
> > Hi Peter,
> >
> > ----- Peter Slegg <p.slegg@scubadivers.co.uk> a =E9crit :
> > > http://gcc.gnu.org/onlinedocs/cpp/Misnesting.html
> > >
> > > Does this suggest that my error shouldn't happen ?
> >
> > The first example suggest that the outter macro is evaluated first. So the
> > error is expected.
> >
> > You could use something like the following instead :
> > #define my_objc_draw(tree, start) objc_draw(tree, start, tree[0].ob_x-3,tre
> > e[0].ob_y-3,tree[0].ob_width+6,tree[0].ob_height+6)
> > .
> > .
> > my_objc_draw(dlog, start);
> >
>
> That may be the only way to work around this but there does seem

Why not define the outer macro as inline function?

#ifndef __TURBOC__
__inline__ void my_objc_draw(dlog, start);
#else
..
#endif

Correct syntax may differ.

> to be a gcc problem when you compare the gcc -E results with those of
> make.

This is mysterious. You should use the same gcc-command that make uses and add the -E.

My test definitely shows that gcc and bcc behave that way.

-Helmut