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