Yotam
Yotam

Reputation: 10485

Xcode: Extra tokens at end of #ifdef directive

This little peace of code

#ifdef QA || DEBUG

do something

#endif

creates the following error:

Extra tokens at end of #ifdef directive

I tried removing one pipe, not working. Google only shows similar questions for cpp with irrelevant answers.

Any idea?

Upvotes: 1

Views: 2218

Answers (1)

filo
filo

Reputation: 697

Use:

#if defined(A) || defined(B)
// do stuff
#endif

or nested condition

#ifdef A
#ifdef B
    // do stuff
#endif
#endif

Upvotes: 2

Related Questions