[PATCH] Do not define the gcc style target specific pre-defined preprocessor macros in clang-cl

Reid Kleckner rnk at google.com
Wed Jul 9 15:58:22 PDT 2014

How much code breaks without this?  Do we really want to do this?  My inclination is to get by without it.  In particular, libyuv has made changes to not assume that __x86_64__ implies __GNUC__ functionality.

Comment at: lib/Basic/Targets.cpp:2592
@@ +2591,3 @@
+  // None of these macros make sense in MSVC compat mode.
+  if (Opts.MicrosoftExt) {
+    if (getTriple().getArch() == llvm::Triple::x86) {
This condition is incorrect, Microsoft builds apps such as Office for Mac with clang with -fms-extensions.  They very likely include system headers that rely on __x86_64__ &co.  This should probably be:

  if (MicrosoftExt)
    ... _M_* macros
  if (MSVCCompat)


More information about the cfe-commits mailing list