title: Avoid redefinition preprocessor variable
body: <p>I have various preprocessor variables which have the same name in different libraries.</p>
  
  <p>In order to avoid conflicts, what I am doing is (in the example there is only 1 conflicting variable and 1 header to include for simplicity):</p>
  
  <pre><code>#ifdef VAR
  #define TEMPVAR VAR
  #undef VAR
  #endif   
  
  #include "conflictingheader.hh" 
  
  #ifdef VAR
  #undef VAR
  #endif
  
  #ifdef TEMPVAR
  #define VAR TEMPVAR
  #undef TEMPVAR
  #endif
  </code></pre>
  
  <p>Is there an automatic way to store all the conflicting variables, undefine them and restore them later? </p>
  
  <p>Or is it possible to define a macro to perform these set of operations?</p>