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 msvc support for UTF_CPP_CPLUSPLUS #125

Closed

Conversation

GoodenoughPhysicsLab
Copy link

// Determine the C++ standard version.
// If the user defines UTF_CPP_CPLUSPLUS, use that.
// Otherwise, trust the unreliable predefined macro __cplusplus

Yeah, in msvc, __cplusplus == 199711L, but we can use _MSVC_LANG for the same behavior. I give this patch because msvc is a popular compiler as gcc, clang.

@GoodenoughPhysicsLab GoodenoughPhysicsLab changed the title fix UTF_CPP_CPLUSPLUS support for msvc fix msvc support for UTF_CPP_CPLUSPLUS Nov 10, 2024
@nemtrif
Copy link
Owner

nemtrif commented Nov 16, 2024

The goal is to avoid any compiler-specific code, including version macros. It is easy enough to define UTF_CPP_CPLUSPLUS if a compiler does not set __cplusplus correctly.

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