#elif not compiling in GLSL


#1

So i have:

#ifdef PARAM_1

#elif PARAM_2

#else

#endif

I’m getting compile error: “Syntax error in #if” as soon as I’m setting PARAM_2
But this:

#ifdef PARAM_1

#else
#ifdef PARAM_2

#else

#endif
#endif

works fine with no errors.

Is it a bug? Or just something Urho does or does not?

I’d like to have #elif to work, because I going to have many such params.


#2

try #elif defined(…)

p.s. #ifdef is equivalent to #if defined (not just #if), so #elif can not be part of #ifdef#endif