The #if and #elif directives require an argument.
The balance of the line is first tokenised by the standard Felix tokeniser and thus may contain Felix literals and Felix identifiers.
The line is then expanded by macro substitution. The result is then parsed as an expression and constant folded and must yield a boolean constant. Note that every name encountered must name a preprocessor macro.
1: include "std"; 2: print "Defining FIRST"; endl; 3: #define FIRST 4: #ifdef FIRST 5: print "detected FIRST"; endl; 6: #else 7: print "BAD"; endl; 8: #endif 9:
1: include "std"; 2: #define FIRST 1 3: #define SECOND 2 4: #if FIRST == 1 and SECOND == 2 5: print "OK"; endl; 6: #else 7: print "BAD"; endl; 8: #endif 9:
1: include "std"; 2: #define FIRST 1 3: #define SECOND 2 4: #if if FIRST == 1 then SECOND == 2 else 1 == 0 endif 5: print "OK"; endl; 6: #else 7: print "BAD"; endl; 8: #endif 9:
1: #define FIRST 1 2:
1: include "std"; 2: #import "mac105a.flx" 3: #ifdef FIRST 4: print "OK"; 5: #else 6: print "BAD"; 7: #endif 8: endl; 9: