-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
cross-plat: wrap wchar type and string literal #456
Comments
Have you tried building in SD with these changes to see if char16 works? |
FYI @LouisLaf discovered that C++11 requires that function static variable initialization must be thread safe this morning and really liked that benefit. He was starting to agree that it might be really beneficial to min support C++11 compliant compilers. I don't want to block this work nor stray offtopic, but do want to note that if we did jump to C++11 only compilers then we would be able to use |
@ianwjhalliday that's a great point but I think that's a longer separate discussion that we should have (feel free to open a separate issue). We need to close on this particular issue more rapidly since it's currently impeding progress on the cross-plat efforts. |
@digitalinfinity agreed. I'll write up a new issue to discuss C++11. I like |
+1 for |
(Or just not replace since the macros will handle the job in any case.) |
I had trouble referencing
@tcare Anything in particular or steps you want me to try? (Send offline if not applicable here.) |
See PR #460 |
One other option which is worth considering is, we use char16_t everywhere since that's the standard type. And in the case of VS2013, we can typedef wchar_t to char16_t. What do others think? (We'll still need the _u macro). |
That's a good idea. I'm for trying that out. |
That sounds like a good idea to me too. Then we would be one step closer to using all standard modern C++ types. |
+1 on |
I'll try out |
I have tried On VS 2013 this works:
On VS 2015, trying to use native
On Unix we use PAL with which |
A little awkward. Stage 1 might be sufficient for a long time. Sounds reasonable to me. |
+1 on Stage1 How about defining
|
Thanks all for the discussion! I'll update the PR with
One issue with typedef to |
@jianchun that makes perfect sense. Thanks for details. |
Just ran into a problem on VS 2015 with Going back to |
Bummer. Oh well, sounds good. |
Just a note: according to the C++ standard, types ending in |
Thanks all for the discussion and ideas. I have pushed PR #460 with |
wchar_t
andL"..."
use 2-byte chars on Windows but 4-byte chars on Unix. We need a common representation for cross-platform. We have been experimenting withwchar16
andCH_WSTR
in "linux" branch, and realized that's a lot of code noise and would probably result in merge hell. We would like to do a batch replacement in "master" with better named typedef/macro.C++11 has
char16_t
andu"..."
. But unfortunately that's not supported by VS2013.[UPDATE 3/7]: We are planning with
char16
and_u("...")
. Below is older message.Please chime in if you have ideas. I'm planning to try batch replacements soon.
The text was updated successfully, but these errors were encountered: