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

Douglas Gregor dgregor at apple.com
Fri Aug 6 07:28:10 PDT 2010


On Aug 6, 2010, at 4:19 PM, Bjorn Reese wrote:

> On 2010-08-06 15:45, David Chisnall wrote:
>> On 6 Aug 2010, at 14:21, Douglas Gregor wrote:
>> 
>>> I wonder how much will break if we start defining _MSC_VER? Does anyone know how mingw deals with this?
>> 
>> We already define the GCC version macros so that we can act as a drop-in replacement for GCC.  If we're aiming to act as a drop-in replacement for MSVC then it would make sense to define their version macros and treat any incompatibilities in MS-extensions mode as bugs, just as we treat incompatibilities with GCC in GNU C modes as bugs.
> 
> Defining _MSC_VER or __GNUC__ or any other macro that identifies another
> compiler is a problem because it makes it very difficult to handle
> differences or defects via predefined macros.

... and not defining predefined macros makes it very difficult to handle code written for the dominant compiler on a platform. We're completely broken on Mac and Linux systems if we don't pretend to be GCC, and it appears that we'll have the same issue with MSVC on Windows.

	- Doug



More information about the cfe-dev mailing list