title: undefine and redefine the __cplusplus macro
body: <p>I want to undefine and redefine the __cplusplus macro am getting however compilation error:<code>__cplusplus was not declared in this scope</code></p>
  
  <pre><code>#define TEMP_VERSION __cplusplus // temporary macro to hold the __cplusplus  containt
  #undef __cplusplus
  #define __cplusplus TEMP_VERSION  // redefine __cplusplus
  
  #define AA 111
  #undef AA
  #define AA 111
  
  int main()
  {
      cout &lt;&lt; "__cplusplus = "&lt;&lt;__cplusplus&lt;&lt;endl; // It doesn't work
      cout &lt;&lt; "AA = "&lt;&lt;AA&lt;&lt;endl; // It works
  
      return 0;
  }
  </code></pre>
  
  <ul>
  <li>Question 1: Why it is not working with the <code>__cplusplus</code> but works with <code>AA</code></li>
  </ul>
  
  <p>I know that this is really ugly but the reason why am undefining the macro is that I am using a third party Software where they are missusing the <code>#ifdef __cplusplus</code>, I mean the content of the <code>#ifdef __cplusplus ... #endif</code> is wrong. So instead of changing their software I choosed to do the following </p>
  
  <pre><code>#define TEMP_VERSION __cplusplus
  #undef __cplusplus
  #include &lt;third_party_sw.h&gt;
  #define __cplusplus TEMP_VERSION
  </code></pre>
  
  <ul>
  <li>Question 2: What do you think is it a good approach ?</li>
  </ul>