PhilHornby
Senior Member
Code:
[COLOR=navy]#macro [/COLOR][COLOR=black]GivesError[/COLOR]
[COLOR=navy]#ifdef [/COLOR][COLOR=black]x
[/COLOR][COLOR=purple]b0 [/COLOR][COLOR=darkcyan]= [/COLOR][COLOR=navy]1
#else
[/COLOR][COLOR=purple]b0 [/COLOR][COLOR=darkcyan]= [/COLOR][COLOR=navy]2
#endif
#endm[/COLOR]
Indenting the "#ifdef" changes the error message to the "#else" statement instead ...
Code:
[COLOR=navy]#macro [/COLOR][COLOR=black]GivesError
[/COLOR][COLOR=navy]#ifdef [/COLOR][COLOR=black]x
[/COLOR][COLOR=purple]b0 [/COLOR][COLOR=darkcyan]= [/COLOR][COLOR=navy]1
#else
[/COLOR][COLOR=purple]b0 [/COLOR][COLOR=darkcyan]= [/COLOR][COLOR=navy]2
#endif
#endm[/COLOR]
It's not though - no combination of indentations remove the error (nor does removing the #else).
I'm assuming that the "#ifdef" construct is not allowed within a macro. By design? -- if so, more meaningful error message please
Last edited: