Closed Bug 1228911 Opened 10 years ago Closed 9 years ago

Define char16_t as an independent type which cannot be implicitly converted to wchar_t for VS2013

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: xidorn, Unassigned)

References

Details

Currently, we do "typedef wchar_t char16_t" for VS compilers before VS2015, because of lack of native support of char16_t there. However since VS2015 (as well as GCC on Windows), we now have an independent char16_t which cannot be implicitly converted with wchar_t. But unfortunately we haven't yet made our infrastructure run VS2015, and consequently this char type issue frequently breaks VS2015 builds (see bug 1192248, bug 1198936, bug 1200187, bug 1213123), which is annoying. I suggest we add a class for char16_t for VS2013 in Char16.h which simulates the behavior of char16_t in other platforms, so that people won't be able to land code which breaks VS2015 build because of this kind of issues.
glandium, could you take this? I don't have a VS2013 installed on my machine currently.
Flags: needinfo?(mh+mozilla)
(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #1) > glandium, could you take this? I don't have a VS2013 installed on my machine > currently. I don't have a VS2013 installed either.
Flags: needinfo?(mh+mozilla)
It seems to me that it is impossible to do so, because the new type must be a primitive type, otherwise it is not possible to put it inside union. But we don't want it to be an alias of any existing primitive type. Let's live with the breakage every now and then, and hopefully we get VS2015 into our infra soonish.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.