[HLSL] How to do AND or OR?

Started by
3 comments, last by maxest 12 years, 7 months ago
As in the title. I want some code to be processed only if macro 1 OR macro 2 is defined. I try:

#ifdef MACRO1 || MACRO2

but that doesn't work. Any hint? :)
Advertisement
Use #if instead, and define those values with a value of 1 (or 0 if you want them to be disabled). If the macro isn't defined, it will come through as a value of 0.
So you suggest something like:

#if defined(MACRO1) | defined(MACRO2)

? Is | allowed here?
You want
#if (defined(MACRO1) || defined(MACRO2)) && defined(MACRO3)
...
#endif
Yup, that works. Thanks!

This topic is closed to new replies.

Advertisement