Closed Bug 924011 Opened 11 years ago Closed 11 years ago

Do not assume that PRUnichar and UChar are the same type

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (v1) (obsolete) — Splinter Review
No description provided.
Attachment #814016 - Flags: review?(jwalden+bmo)
It's worth noting that there's a macro you can set to make ICU define UChar to char16_t instead.
(In reply to Joshua Cranmer [:jcranmer] from comment #1) > It's worth noting that there's a macro you can set to make ICU define UChar > to char16_t instead. What is that macro? That sounds fine to me, personally.
The macro would be fine, if it won't break Linux distros that link against a system ICU. I don't know if that'll be a problem or not, exactly.
Comment on attachment 814016 [details] [diff] [review] Patch (v1) Review of attachment 814016 [details] [diff] [review]: ----------------------------------------------------------------- Let's consolidate all these casts into a single cast in a utility method in Intl.h. inline const UChar * JSCharToUChar(const jschar *chars) { return reinterpret_cast<const UChar*>(chars); } Or something along those lines. Given leeriness about the system ICU thing, let's punt on the macro bit until distros have implemented a system-ICU option (which presumably they've held off on because bug 853301 hasn't landed yet).
Attachment #814016 - Flags: review?(jwalden+bmo)
Attached patch Patch (v2)Splinter Review
Attachment #814525 - Flags: review?(jwalden+bmo)
Attachment #814016 - Attachment is obsolete: true
Comment on attachment 814525 [details] [diff] [review] Patch (v2) Review of attachment 814525 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/builtin/Intl.h @@ +186,5 @@ > +JSCharToUChar(const jschar *chars) > +{ > + return reinterpret_cast<const UChar *>(chars); > +} > +inline UChar * Blank line before this.
Attachment #814525 - Flags: review?(jwalden+bmo) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: