How to distinguish MYDEF and MYDEF() with #ifdef

Wesley Smith wesley.hoke@gmail.com
Tue Jul 24 13:44:00 GMT 2007


Or why not

#define _OLD_MYDEF MYDEF
#undef MYDEF

#define MYDEF //<-- yours

//use it


#undef MYDEF

#define MYDEF _OLD_MYDEF

which is untested and a bit ridiculous but should work.  If you don't
need MYDEF anymore in this particular file then you can leave off the
bottom section.

wes



On 7/24/07, John Love-Jensen <eljay@adobe.com> wrote:
> Hi Frank,
>
> I do not believe there is a discriminator predicate between MYDEF and
> MYDEF() preprocessor directives for the #if.
>
> I suggest you rely on another preprocessor symbol from the relevant header
> files to use as a discriminator between MYDEF and MYDEF().
>
> Alternatively, change the MYDEF() to MYDEF_FN().  Or if you are a radical
> (like myself) use $MYDEF and MYDEF$() and the -fdollars-in-identifiers GCC
> flag.
>
> HTH,
> --Eljay
>
>



More information about the Gcc-help mailing list