|
|
|
|
|
by ramshorns
1917 days ago
|
|
Why does the C preprocessor need the #elif syntax at all? C doesn't have it, it just achieves "else if" by embedding the second if statement inside the else clause. But maybe that wouldn't work in the preprocessor? #if FOO
foo();
#elif BAR
bar();
#endif
#if FOO
foo();
#else
#if BAR
bar();
#endif
#endif
I guess it works but it's clunkier. |
|
C itself doesn't need this, because you can write `else if …` without needing to put another layer of braces around the subordinate `if` statement.