STL icon indicating copy to clipboard operation
STL copied to clipboard

`<yvals_core.h>`: Unify stringification macros

Open frederick-vs-ja opened this issue 1 year ago • 1 comments
trafficstars

Currently, MSVC STL defines two stringization macros in <yvals_core.h> for mutually exclusive cases.

https://github.com/microsoft/STL/blob/3eac329d1f614ecf138d96c22a3b02f87076bc4a/stl/inc/yvals_core.h#L25-L26

https://github.com/microsoft/STL/blob/3eac329d1f614ecf138d96c22a3b02f87076bc4a/stl/inc/yvals_core.h#L1946-L1947

Would it be better to unconditionally defined one and consistently use it?

Also, _EMIT_STL_MESSAGE currently relies on _CRT_STRINGIZE. https://github.com/microsoft/STL/blob/3eac329d1f614ecf138d96c22a3b02f87076bc4a/stl/inc/yvals_core.h#L518

Would it be better to change to use the STL-internal version?

frederick-vs-ja avatar Jan 13 '24 03:01 frederick-vs-ja

Thanks for noticing this! We did a bit of programmer-archaeology - what happened here is that _STRINGIZE is the classic macro we've used, _CRT_STRINGIZE was introduced during the UCRT split, and #2897 introduced _STL_STRINGIZE (instead of moving/renaming _STRINGIZE, apparently in an oversight).

We believe that we should standardize on _STL_STRINGIZE since it has a better name and is defined as early as possible, completely eliminating _STRINGIZE and replacing our usage of _CRT_STRINGIZE.

StephanTLavavej avatar Jan 17 '24 22:01 StephanTLavavej