2

How do I write the following in the preprocessor directive language?

if (isfullversion and isproduction)

else if (isliteversion)

end if

2 Answers 2

3

You should be able to write the conditions you already have for the preprocessor if you want, rather than just checking if they are defined.

#if (isfullversion && isproduction)

#elif (isliteversion)

#endif
Sign up to request clarification or add additional context in comments.

Comments

2

You create separate targets. one for the lite version, one for the full version, then add compiler flags like -DLITE then check #ifdef LITE in your code.

2 Comments

I've already done that. What I don't know is how to write the #ifdef part for the above conditions
You need to place that around the sections of code that you want for just the lite version, or just the full version, depending on the preprocessor define. You need only define one (whichever one makes sense for your purpose) as the !THAT_THING will be the other. I.e., if you define LITE then #ifndef LITE will be full.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.