title: Build in Visual C++ without Microsoft extensions
body: <p>I am trying to build a project in Microsoft Visual C++ 2013 disabling all non standard extensions.</p>
  
  <pre><code>#ifdef _MSC_VER
  #include &lt;windows.h&gt;
  #endif
  </code></pre>
  
  <p>In Configuration Properties --> C/C++ --> Language, I set "Disable Language Extensions" to yes (/Za).<br>
  However, building the previous code I get errors such as:</p>
  
  <blockquote>
    <p>C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(11527):
    error C2467: illegal declaration of anonymous 'struct'</p>
  </blockquote>
  
  <p>This means that the _MSC_VER macro is still defined, and "windows.h" has been included.  </p>
  
  <p>How can I include a file if and only if I am using Visual C++?  </p>
  
  <p>How can I set Visual C++ so that it compiles the code as Standard C++, marking all Microsoft extensions as errors?</p>