pcpp icon indicating copy to clipboard operation
pcpp copied to clipboard

Avoid macro expansion

Open soumyaranjansabat opened this issue 3 years ago • 1 comments

How can only the #if and #else be evaluated and pre-processed and avoid macro expansion of any available macros in the code?

Tried overiridng with few PreprocessorHooks but unsuccessful. Would really appreciate some help.

Input #define PARAM_A STD_ON #define LOOPVAL 3

#if (PARAM_A== STD_ON) while(iter < LOOPVAL ) {

} #endif

Expected Output while(iter < LOOPVAL ) {

}

Not Expected Output while(iter < 3) {

}

Similarly for other macro like functions etc.

soumyaranjansabat avatar Dec 26 '21 17:12 soumyaranjansabat

Supply me your PreprocessorHooks implementation and I'll take a look.

ned14 avatar Jan 21 '22 14:01 ned14