I have been trying to get the preprocess() function to work, since version 10.0.
Now using 12.02 I'm still having problems getting it working, as well as trying to understand why it is performing the way it is.
In the C project I'm trying to preprocess, I have to parse our header files externally from Slick.
The program that parses the header files also dynamically generates a Slick macro, which contains
a call to preprocess(), with a huge string of symbol definitions as the argument to preprocess().
In another Slick Macro, I then iterate over all the open files/buffers, using args in the call to preprocess() to define/undefine the symbols.
Most of the C files are preprocessed ok (I haven't checked every line in every file).
But for some reason, at least one header file is not preprocessed correctly.
So I've eliminated all of the steps of parsing the headers externally to slick, and pasted a simple call to preprocess() on the slick command line, with only a few symbols.
I do this while the header file in question is "selected", and again, preprocess() does not fold the lines I expect.
This is a subsection of the header file having the problem
#if SWITCH_TYPE == ABC1234
#define SYM_THIS_SYMBOL FALSE
#elif SWITCH_TYPE == DEF5432
#define SYM_THIS_SYMBOL TRUE
#endif
It's just simple C preprocessor directives.
The call on the Slick cmd line looks like this
preprocess -w TRUE=1 FALSE=0 ABC1234=100u DEF5432=200u SWITCH_TYPE=ABC1234
When I change it to this
preprocess -w TRUE=1 FALSE=0 ABC1234=100u DEF5432=200u SWITCH_TYPE=DEF5432
I would expect the logic to be reversed with the second call to preprocess, but the outcome is the same.
When I remove the -w in the call to preprocess, Slick complains that SWITCH_TYPE is not defined, as well as all of the other symbols in the call to preprocess()
Why is this SWITCH_TYPE not defined, when I explicitly define it on the command line?
Would someone shed some light on what I am doing incorrectly?
Thanks