title: Compile time checking of conditional compilation symbols in C# (see example)?
body: <p>In C/C++ you can do something like:</p>
  
  <pre><code>#define IN_USE      (1)
  #define NOT_IN_USE (-1)
  
  #define USING( system ) ( 1 / (system) == 1 / IN_USE )
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>#define MY_SYSTEM  IN_USE
  
  #if USING( MY_SYSTEM )
      &lt;my_system impl&gt;
  #endif
  </code></pre>
  
  <p>This sort of setup means:</p>
  
  <ul>
  <li><p>All conditional compilation symbols have to be defined either IN_USE or NOT_IN_USE.</p></li>
  <li><p>I can put them all in a single header file (or a couple) and easily turn them on/off and see what conditional compilation symbols there are.</p></li>
  <li><p>A typo like #if USING( MYSYSTEM ) is caught by the compiler due to div by 0 rather than silently compiling it out.</p></li>
  </ul>
  
  <p>Is it possible to do this in C#?  Is there another best practices way to achieve the same effect?</p>
  
  <p>I realize in C# you can do conditional compilation by setting them in the project settings and using #if, but I dislike the fact that something doesn't have to be explicitly undefined.  This is the reason in the project settings you have the "DEBUG" and "TRACE" checkboxes.  If they weren't there, you'd have no idea you could turn them on.</p>