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

Consider using _MSVC_LANG to detect cpp version #85

Closed
depler opened this issue Dec 1, 2021 · 1 comment
Closed

Consider using _MSVC_LANG to detect cpp version #85

depler opened this issue Dec 1, 2021 · 1 comment

Comments

@depler
Copy link

depler commented Dec 1, 2021

Visual Studio has very conservative approach for macro __cplusplus. Even when used with /std:c++17 switch it still shows this:

image

So by fact Visual Studio will not use cpp17.h header without forcing value UTF_CPP_CPLUSPLUS to 201703L. For windows it is better to use this:

#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
//whatever
#endif

Related issue in transmission: transmission/transmission#2256

@nemtrif
Copy link
Owner

nemtrif commented Dec 2, 2021

I really don't want to chase compiler-specific corner cases.

Setting UTF_CPP_CPLUSPLUS to 201703L is the way to address the issue.

@nemtrif nemtrif closed this as completed Dec 2, 2021
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

No branches or pull requests

2 participants