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

Allow wchar_t constructors of iostreams on Windows when using libc++ #69

Merged
merged 1 commit into from
Aug 21, 2020
Merged

Allow wchar_t constructors of iostreams on Windows when using libc++ #69

merged 1 commit into from
Aug 21, 2020

Conversation

zero9178
Copy link
Contributor

@zero9178 zero9178 commented Aug 21, 2020

To be able to open files in eg. UTF-8 encoding the wchar_t functions must be used on Windows. Currently __GNUC__ is used as libstdc++ does not have a wchar_t constructor for it's ofstreams. Libc++ does on Windows however and matches Microsoft's behavior. This commit changes the check from __GNUC__, a macro that is also defined when using Clang with a *-*-windows-gnu triple, to instead check for libstdc++ through the __GLIBCXX__ triple. This would even allow GCC to use these functions when using libc++.

… __GNUC__ to __GLIBCXX__ as libc++ provides these on Windows as well
@gulrak gulrak added the enhancement New feature or request label Aug 21, 2020
@gulrak gulrak merged commit 46db4d8 into gulrak:master Aug 21, 2020
@gulrak
Copy link
Owner

gulrak commented Aug 21, 2020

Thank you for the PR, that's a good idea.

@gulrak gulrak added this to the v1.3.4 milestone Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants