IDE conditional block allocation

SETUP:

Imagine that I have a pretty good size program, and #defines and various means of including / excluding various pieces of code are used.

those. Suppose I have code like this

example_file.c:

include <definition_file> #ifdef THIS do something really cool here #ifdef THAT do something even cooler #endif #endif 

definition_file.c:

 #define THAT TRUE #define THIS FALSE 

Now I do not know that not a single operator will be included or used unless I look in the definition. The above example, but suppose you say 50 ifdefs, and they are nested in different ways, keeping track that each of the 50 values ​​is a pain in the butt.

Question:

Is there a program / environment that, for example, is gray or highlights the entire code snippet, indicating that based on your "control file" they will not be included or will be included. (some visual or other indication)

Note: If someone can improve the name or question, please, by all means, I'm really at a loss for what to call it. (or suggest the best tags too)

+4
source share
2 answers

Visual Studio 2010 will do this for both C ++ (with varying degrees of success) and C # (100% more reliable).

I assume that you do not want to hear about alternatives related to code refactoring (polymorphism, different libraries and link timing, what to link to, etc.)

+5
source

Eclipse (with CDT) also does this.

+3
source

Source: https://habr.com/ru/post/1389540/


All Articles