Skip to content

Conversation

@obastemur
Copy link
Collaborator

ChakraCore uses char16_t on xplat and wchar_t on Windows for 2 bytes wide strings.
The reason we alter wchar_t to two bytes char16_t is that Unix wchar_t is 4 bytes long.

This PR removes the code that alters wchar_t and replaces all the instances of wchar_t with WCHAR.

Only ChakraCommonWindows.h is not updated.

ChakraCore uses char16_t on xplat and wchar_t on Windows for 2 bytes wide strings.
The reason we alter wchar_t to two bytes char16_t is that Unix wchar_t is 4 bytes long.

This PR removes the code that alters wchar_t and replaces all the instances of wchar_t with WCHAR.

Only ChakraCommonWindows.h is not updated.
@Penguinwizzard
Copy link
Contributor

lgtm; the only small and fairly pedantic comment I have is that theoretically it'd be more predictable using uint16_t to define WCHAR in the two places where it's defined, as that aligns more narrowly with what windows' wchar_t is specified as. In both of the situations where that'd be an issue, though, there'd likely be innumerable other issues from the difference (not to mention windows itself might do things differently there), so doing a char16_t if possible and an unsigned short otherwise should be more than good enough.

@obastemur
Copy link
Collaborator Author

@Penguinwizzard Thanks for the review!

@chakrabot chakrabot merged commit cb0eaef into chakra-core:master Jan 4, 2017
chakrabot pushed a commit that referenced this pull request Jan 4, 2017
Merge pull request #2288 from obastemur:no_wchar_t

ChakraCore uses char16_t on xplat and wchar_t on Windows for 2 bytes wide strings.
The reason we alter wchar_t to two bytes char16_t is that Unix wchar_t is 4 bytes long.

This PR removes the code that alters wchar_t and replaces all the instances of wchar_t with WCHAR.

Only ChakraCommonWindows.h is not updated.
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.

4 participants