CyberMew
CyberMew

Reputation: 1421

ObjC macro ifdef and defined

I'm trying to do a macro where if AAA and BBB does not exists. Something like this:

#ifdef !AAA && !BBB
#endif

or this:

#ifndef AAA || BBB
#endif

However, Xcode is throwing me errors, so I've tried #ifdef !(defined AAA) && !(defined BBB) or some other such combinations and it seems like Xcode doesn't seems to understand defined. I'm getting "Macro names must be identifiers" or "Extra tokens at the end of #ifdef directive" errors.

Any idea how I could workaround this problem?

Upvotes: 1

Views: 1196

Answers (1)

DanielG
DanielG

Reputation: 2377

Can you just use #if?

#if !defined(AAA) && !defined(BBB)

Upvotes: 3

Related Questions