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

Fix compatibility with older versions of VS #4271

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

YexuanXiao
Copy link
Contributor

In the previous PR, I mentioned that there were no compatibility issues, but I was wrong. I confused the versions of VS and MSVC. _MSVC_STL_UPDATE appeared later than the VS version that fmt promised to support. This PR will fix this issue.

Comment on lines 66 to 72
#ifdef _MSVC_STL_UPDATE
# define FMT_MSVC_STL_UPDATE _MSVC_STL_UPDATE
#elif defined(_MSC_VER) && _MSC_VER < 1912 // VS 15.5
# define FMT_MSVC_STL_UPDATE _MSVC_LANG
#else
# define FMT_CPLUSPLUS __cplusplus
# define FMT_MSVC_STL_UPDATE 0
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this to ostream.h where it is used.

@vitaut
Copy link
Contributor

vitaut commented Dec 21, 2024

Also to clarify: _MSVC_STL_UPDATE is only supported since MSVC 2019, right?

@YexuanXiao
Copy link
Contributor Author

Also to clarify: _MSVC_STL_UPDATE is only supported since MSVC 2019, right?

To be precise, it has been supported since MSVC 19.12. Therefore, for versions from 19.00 to 19.12, use _MSVC_LANG instead. fmt has already declared that it does not support MSVC before version 19.00. Here are two version reference tables: _MSC_VER and _MSVC_STL_UPDATE.

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