Hi, I am wondering what's wrong with the following code. I simply want to #undef the macro _CHAINED_LLR_LOADING. However, the macro get's undefined even when the value of foo is 0. I am sure I am missing something important about the use of #ifdef and #undef.
Thanks for any hint.
void bar(void){
if(foo){
#ifdef _CHAINED_LLR_LOADING
status=1;
#undef _CHAINED_LLR_LOADING
printf("chained was modified\n");
#endif
}else{
status=0;
//#define _CHAINED_LLR_LOADING
}
}
GA
#ifdef is executed by the preprocessor at compile time, if (foo) is executed at run time
All the preprocessor stuff in unaware on how your program will act