[prev in list] [next in list] [prev in thread] [next in thread]
List: pcc-list
Subject: Re: Macro wrappers
From: Anders Magnusson <ragge () ludd ! ltu ! se>
Date: 2007-11-16 9:49:30
Message-ID: 473D67AA.6020406 () ludd ! ltu ! se
[Download RAW message or body]
Gregory McGarry wrote:
> I have a patch to make the calls to the backend consistent: mycanon(),
> myoptim(), myreader(), mtp2tree().
>
> Some of these are wrapped in pre-processor macros, while others are
> not. The change is to always call all the backend functions and let
> the compiler optimise away empty functions. I think it's more obvious
> when synchronising changes amongst the different backends.
>
> -# ifdef MYP2TREE
> - MYP2TREE(p); /* local action can be taken here; then
> return... */
> -# endif
> + myp2tree(p); /* local action can be taken here; then
> return... */
>
At least it looks prettier. Note that there have been use of these
functions like
#define MYP2TREE(p) if (p->foo) return;
but if that's ever needed again a target can define myp2tree() in macdefs.
Having functions seems better anyway. Please go ahead.
-- Ragge
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic