[cfe-dev] Extra #defines for Windows SDK 6.0a/VS2008

Douglas Gregor dgregor at apple.com
Fri Aug 6 07:31:45 PDT 2010


On Aug 6, 2010, at 4:00 PM, Jesse Towner wrote:

> On Fri, 2010-08-06 at 15:24 +0200, Douglas Gregor wrote:
> 
>> I wonder how much will break if we start defining _MSC_VER? Does anyone know how mingw deals with this?
>> 
> 
> I recently replied to Per on this, but forgot to CC it to the list, so
> I'll provide the relevant stuff here.
> 
> MinGW has it's own version of the Platform SDK headers
> in /include/w32api, and unfortunately it has a hard time working with
> with the latest Platform SDK, DirectX SDK, or other SDK releases from
> Microsoft until someone ports it to work with MinGW. I think Cygwin is
> the same.
> 
> Intel C++ mimics MSVC++ to the extent that it defines _MSC_VER and
> supports the same compiler extensions, and developers accustomed to
> checking for __INTEL_COMPILER/__ICL before _MSC_VER to differentiate
> between the two. That way it acts as a drop-in replacement for MSVC++.
> And naturally, ICC also mimics GCC on Linux.
> 
> Borland C++ came with it's own copy of the Platform SDK headers, but I
> think in it's later days it became compatible with MSVC++ in the same
> way that Intel C++ is. I'm not 100% sure though.

Okay, let's go for it. I don't have access to Visual Studio, so I'm asking for people with access to this compiler to provide patches. I strongly suggest going through the predefined macros documented here:

	http://msdn.microsoft.com/en-us/library/b0084kay.aspx

and making sure that, when we're in Microsoft mode (something that we may need to add, beyond just -fms-extensions), we define all of the same things they do. For example, _CPPRTTI when RTTI is enabled. Just adding _MSC_VER is only a partial solution that isn't likely to help all that much in isolation.

Which version of Visual C++ do we emulate? I'm guessing Visual Studio 2008 (_MSC_VER = 1500), since VS2010 has C++0x features that we don't support.

	- Doug



More information about the cfe-dev mailing list