Microsoft Specified LangOpts - don't appear to be working?

Hello,

I’m using clang as a library, and am trying to compile a program that uses Windows.h. I’ve gone and set the following LangOptions:

lo.MSVCCompat = true;

lo.MSCompatibilityVersion = clang::LangOptions::MSVC2013;

lo.MicrosoftExt = true;

lo.AsmBlocks = true;

lo.DelayedTemplateParsing = true;

This fixed some issues with AsmBlocks and the IUnknown issue (hence the delayed template parsing), but Windows.h still doesn’t compile.

So, I tried setting STDC after reading some things online (Microsoft made a member of a type called bool … yeah, http://lists.llvm.org/pipermail/cfe-dev/2010-August/010174.html), however this results in yet more issues and it’s not clear if my setting STDC caused this.

My question is, am I missing some key step in enabling VC++ compatibility?

Thank you in advance,

Joshua

MSCompatibilityVersion should probably be set this way:
lo.MSCompatibilityVersion = clang::LangOptions::MSVC2013 * 10000000U;
MSCompatibiltiyVersion is the value you want for the _MSC_FULL_VER macro.