How to distinguish MYDEF and MYDEF() with #ifdef

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

 



Hi,

I have two different versions of an include file that in one version defines

#define MYDEF { ... }

and in the other version it defines the same but with "()":

#define MYDEF() { ... }

My code needs to work with both, but for #ifdef both seem to be the same. However, trying to execute MYFUNC() if only MYFUNC is defined results in a compile time error. My idea was to use

#ifdef MYDEF
  MYDEF;
#elif defined MYDEF()
  MYDEF();
#endif

but the first #ifdef evaluates to true in both cases. Any idea how to do this?

Thanks,
Frank

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux