The last topic I saw on this was in 2012
https://community.slickedit.com/index.php?topic=7797.0 , hoping there has been improvement on ways to support this.
I have a code base with extensive use of macro's for meta-programming spread across multiple files. Same as shown in the above reference thread from 2012: the macro's define multiple constructs, but ultimately the big thing I need that is missing is the enum definitions. Simple example below:
#define FOO_SIG_LIST(x)\
x(sig_foo_a) x(sig_foo_b)
#define BAR_SIG_LIST(x)\
x(sig_bar_a) x(sig_bar_b)
#define GLOBAL_SIG_LIST(x)\
FOO_SIG_LIST(x) BAR_SIG_LIST(x)
#define AS_ENUM(x,...) x,
enum {
GLOBAL_SIG_LIST(AS_ENUM)
};
and then later on used in the code primarily with
...
swith (sig){
case sig_foo_a:
case sig_bar_b:
}
As it is right now, SE can't recognize the enum expansion so I cannot use auto-completion (ctrl-space) or navigation (ctrl-.).
Following the advice from Dennis in the referenced thread from 2012, I added the #defines exactly as above to slickedit's workspace preprocessor file <workspace>_cpp.h, and this worked. So now I have the #defines in both the code as well as the <workspace>_cpp.h, and SE expanded the macro's as expected and correctly picked up the signal enum's.
But this is extremely clunky. Every list needs to be defined twice: one in the project file, and then again in slickedits <workspace>_cpp.h file. Every time a signal is added removed from one of the lists in the actual code, the corresponding #define in the SE <workspace>_cpp.h must also be modified, which makes it basically unmaintainable.
I've already use the <workspace>_cpp.h to solve all the other macro recognition issues, but this last one with variadic expansion I've not been able so solve. SE actually already has all the information from the source code, is there any way to get SE to actually use the #define in the projects actual source code instead of having to redefine it for SE explicitly in <workspace>_cpp.h?