[PATCH] D40285: [MS] AARCH64 cleanup default WIN macros

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 00:56:20 PST 2017


mstorsjo added a comment.

In https://reviews.llvm.org/D40285#931242, @martell wrote:

> The easy one is to get rid of WIN64 because gcc doesn't even do that for mingw.


Yes it does, it behaves just the same as WIN32:

  $ x86_64-w64-mingw32-gcc -E -dM - < /dev/null | grep WIN64
  #define _WIN64 1
  #define __WIN64 1
  #define WIN64 1
  #define __WIN64__ 1



> What are your thoughts here on WIN32, I would prefer to move it.

I'm a little divided - either we remove both WIN32 and WIN64 from all mingw configurations, or we add the missing WIN32 for x86_64 mingw. Removing would be the strictly correct thing to do, but I'm sure it will break code that used to work before (even though it's wrong to rely on the unprefixed one).

> I remember a long time ago a lot of projects moved to _WIN32 when they discovered that it was not supposed to be defined.

Yes, generally projects shouldn't check for the unprefixed defines, but unfortunately some do. I just recently ran into such an issue when building with the x86_64 configuration, where GCC would have had WIN32 defined but clang didn't.


Repository:
  rL LLVM

https://reviews.llvm.org/D40285





More information about the cfe-commits mailing list