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

Ehsan Akhgari ehsan.akhgari at gmail.com
Thu Jul 10 11:30:06 PDT 2014


In our code base I think it's only occurrence of this problem, but I do
expect this to be the sort of thing that breaks more than just libyuv in
the wild.  That being said, I'll leave it up to you whether we should take
this or not, and will address the comment below when landing if we decide
to to do so.

Cheers,

--
Ehsan
<http://ehsanakhgari.org/>


On Wed, Jul 9, 2014 at 6:58 PM, Reid Kleckner <rnk at google.com> wrote:

> 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)
>     return;
>   ...
>
> http://reviews.llvm.org/D4415
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140710/5cbe543c/attachment.html>


More information about the cfe-commits mailing list