On Fri Sep 29 12:27:37 2023 +0000, Jacek Caban wrote:
I wasn't plan using the actual MSVC with Wine build system myself, but yes, in theory we could support that and something like you suggest would be needed then. And yes, `__arm64ec__` is already defined in addition to `_M_ARM64EC` by clang for MSVC targets. BTW, I always considered handling of `_M_<arch>` macros in mingw to be a hack working around GCC shortcomings. They are defined in a header, so they work only if you include any crt headers first, which is not what one could expect. I recall hitting it while porting code to mingw. While it's too late for other platforms, I just feel like we could do better for new ones. I find explicitly skipping `_M_<arch>` macro in clang for mingw targets only to define it in a less reliable way in mingw headers to be sub-optimal.
Yeah, the fact that mingw headers do define `_M_<arch>` but in a header feels a bit indecisive to me; either mingw shouldn't be defining them, forcing everyone to be consistent in using the GNU style names - or they perhaps indeed should be a compiler built-in define.
I somewhat disagree that clang for mingw targets should have gone with defining these though - I think that'd lead to even more confusion. If we'd want to go that way, I think we perhaps should coordinate that with GCC and make both compilers switch to doing that.
In any case, I think this is a separate topic from ARM64EC :-)