-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add support for wchar_t on Windows #111
Conversation
Add wchar_t support for Windows.
Thanks for the pull. Two problems: |
|
Not sure. Maybe simple ifdef will do. Most of them are defined in tweakme.h |
@gabime Could you put some explanation behind making it configurable? The majority of windows desktop applications will use wchar_t (either right away or after they realize their app crash for a lot of users). |
@Kentzo add '''#define use_whcar''' to tweakme.h |
Seems the tests fails because it gets filesize of 2048 but expects 1024.. Makes sense for wchar |
@gabime Fixed, please take a look. |
Thanks. Looks good. |
@gabime Done but tests failed. Not sure if it's due to our changes. |
Add support for wchar_t on Windows
I reverted this - it causes problems - global defines that conflicts with use code. We need to find a cleaner solution. Maybe a dedicated file sink |
Current version is completely unusable without that change on Windows (except developer's environment I guess)... Do you have a set of changes in mind to be made? |
@gabime I'm willing to contribute so we can use spdlog's upstream in our product. Please think of steps this change requires to make it happen. |
Main issue was that it broke user code because it introdeced global defines.. |
@gabime We could use templates |
Another option would be defining a new sink class which supports wchar. This would be the less intrusive option i think. |
What's the status of this? I'm getting
I have already integrated with CppFormat, so I know it supports wchar_t. What am I doing wrong? I searched the code for SPDLOG_USE_WCHAR and couldn't find it. |
@VikingExplorer Change was reverted in the mainstream. We're using our fork for know. Feel free to improve this PR. |
@gabime Is it all right to have the SPDLOG_USE_WCHAR macro though? |
I don't think supporting 2 sink is a good solution: you would end up with 2 identical version of the code… Maybe I put the S macro under the SPDLOG_ namespace? |
I don't know.. The code got quite ugly with all those "tstrings" everywhere.. Not sure it worth it |
@gabime I tried to do it with templates, it becomes even uglier: you cannot easily get around with char and wchar_t string literals. Current implementation is terribly unusable on Windows though: you cannot have a path with Chinese symbols for example. |
@gabime Made another PR that attempts to solve this problem. |
@Kentzo it fails the tests. included file not found.. |
@gabime Fixed. |
Add the SPDLOG_USE_WCHAR tweak to enable support for Unicode names on Windows. Refs #111
No description provided.