[cfe-dev] Extra #defines for Windows SDK 6.0a/VS2008
Douglas Gregor
dgregor at apple.com
Fri Aug 6 01:43:43 PDT 2010
On Aug 5, 2010, at 2:58 PM, per at lumai.se wrote:
> Hi all,
>
> here's a proposed patch for clang/lib/Basic/Targets.cpp::VisualStudioWindowsX86_32TargetInfo that adds three new defines. This allows <windows.h> pass clang compilation both in C and C++. Comments?
Does the Visual Studio compiler actually define all of these macros? We shouldn't be defining any macros just to make things seem to work (e.g., we can't define WIN32_LEAN_AND_MEAN by default). Rather, we should define the same macros that Visual Studio does and, if necessary, we should implement more Microsoft-specific extensions (or even bugs) under -fms-extensions.
_INTEGRAL_MAX_BITS makes sense to define, because it's documented to be defined by Visual Studio.
__STDC__ should probably only be defined in C mode when -pedantic is specified or we're not in Microsoft mode. The logic in InitPreprocessor.cpp could use some tweaking.
- Doug
More information about the cfe-dev
mailing list