Determine when using the VC90 compiler in VS2010 instead of VS2008?

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2010-06-14T20:07:17Z Indexed on 2010/06/14 20:32 UTC
Read the original article Hit count: 269

Is there a (Microsoft-specific) CPP macro to determine when I'm using the VC9 compiler in Visual Studio 2010 as opposed to Visual Studio 2008? _MSC_VER returns the compiler version, so with VS2010 multi-targeting feature, I'll get the same result as with VS2008.

The reason for wanting to know the difference is that I created a new VS2010 project which contains code removed from a larger project. I just left the VS2008 stuff "as is" since we're moving away from VS2008 "soon" anyway and I didn't want to go through the hassle of creating a vcproj file along with the new vcxproj.

For now, I've just defined my own macro to indicate whether the code is compiled into its own DLL or not; it works just fine, but it would be nice if there were something slightly more elegant.

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-c++