Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the _MSVC_STL_UPDATE macro to detect STL #4267

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Conversation

YexuanXiao
Copy link
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
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
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
45 checks passed
@vitaut
Copy link
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