ChakraCore
ChakraCore copied to clipboard
Avoid using MSVC-internal `_STRINGIZE`
I work on Microsoft's C++ Standard Library implementation, where we recently merged microsoft/STL#4405 to remove our internal _STRINGIZE macro. Our "Real World Code" test suite, which builds popular open-source projects like yours, found that you were using this MSVC-internal macro and therefore our change broke your code.
The C++ Standard's rule is that _Leading_underscore_capital identifiers (including _LEADING_UNDERSCORE_ALL_CAPS) are reserved for the compiler and Standard Library, so other libraries and applications should avoid using such reserved identifiers. This is N4971 5.10 [lex.name]/3:
In addition, some identifiers appearing as a token or preprocessing-token are reserved for use by C++ implementations and shall not be used otherwise; no diagnostic is required. — Each identifier that contains a double underscore
__or begins with an underscore followed by an uppercase letter is reserved to the implementation for any use.
This PR introduces non-reserved names that will work on all platforms.
Hi @StephanTLavavej thank you for the heads up about this pending breakage.
Looking at the code it looks to me like only bin/NativeTests/stdafx.h would be broken and the other two instances whilst using a similar name already defined alternative macros; is that correct? Did you rename the others for consistency?
Yes, I renamed them to consistently follow the Standard's rules for reserved identifiers, and to make it easier to verify that there are no remaining dependencies on microsoft/STL's removed macro.