Skip to content

Use the _MSVC_STL_UPDATE macro to detect STL#4267

Merged
vitaut merged 2 commits intofmtlib:masterfrom
YexuanXiao:master
Dec 19, 2024
Merged

Use the _MSVC_STL_UPDATE macro to detect STL#4267
vitaut merged 2 commits intofmtlib:masterfrom
YexuanXiao:master

Conversation

@YexuanXiao
Copy link
Copy Markdown
Contributor

The current code's method of detecting the C++ standard library as STL is inaccurate, which will reject libc++ on Windows. The _MSVC_STL_UPDATE macro is the documented way. fmt currently requires Visual Studio 19.0, and this macro has existed since Visual Studio 15.5, so there are no compatibility issues.

Copy link
Copy Markdown
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good but please fix the issue reported in CI. You might want to use #ifdef instead of #if to fix it.

@YexuanXiao
Copy link
Copy Markdown
Contributor Author

Overall looks good but please fix the issue reported in CI. You might want to use #ifdef instead of #if to fix it.

If the macro is not defined, it will be replaced with 0. The STL never defines _MSVC_STL_UPDATE as 0, so there is no visible difference here. However, if the code style requires it, I am glad to fix it.

@YexuanXiao YexuanXiao requested a review from vitaut December 19, 2024 04:32
@vitaut vitaut merged commit 7c3d015 into fmtlib:master Dec 19, 2024
@vitaut
Copy link
Copy Markdown
Contributor

vitaut commented Dec 19, 2024

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants