On 2017/10/12 15:10, Frédéric wrote:
Hi,

I am using mingw w64 5.0.2 on a linux machine with gcc/g++ 7.2.0.
I noticed that the macro WIN32 is:
- defined if -std=gnu++{98,11,14,17}
- not defined if -std=c++{98,11,14,17}

why such difference?

A library I try to cross-compile tests for WIN32 and fails. I have to
manually change all WIN32 in _WIN32.

 From what I understand, macros without _ are the responsability of
w64, not gcc but I may be wrong.

A name that:
1) begins with (in C) / contain (in C++) two underscores, or
2) begins with an underscore followed by an uppercase letter
is reserved by the implementation for any use.

In strict standard-conforming mode (-std=c++??) use of non-reserved names as macros will break code such as `int WIN32 = 0;`, as the standard does not allow it to fail. Hence, macros with non-reserved names are not defined in this mode. Those with reserved names are provided in both modes.

--
Best regards,
LH_Mouse


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to