Closed Bug 1100997 Opened 10 years ago Closed 10 years ago

Fix FileUtilsWin.h compilation on mingw.

Categories

(Core :: XPCOM, defect)

All
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jacek, Assigned: jacek)

Details

Attachments

(1 file)

Attached patch patch.diffSplinter Review
On GCC char16_t is not the same as wchar_t, so we need a cast.
Attachment #8524657 - Flags: review?(nfroyd)
Attachment #8524657 - Flags: review?(nfroyd) → review+
Thinking about this a little more, we have a raft of 16-bit character methods on nsString...are none of them applicable here?
Flags: needinfo?(jacek)
Sadly no. We use char16_t for internal UTF16 representation, while Windows API uses wchar_t for that. We have char16ptr_t type introduced in bug 928351 to hide the difference, but that's only for constant pointers. There happened to be too few cases where this was needed for non-const pointers, so those few places (like in this case) need an explicit cast.
Flags: needinfo?(jacek)
https://hg.mozilla.org/mozilla-central/rev/1e4f975958f2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
(In reply to Nathan Froyd [high latency from 20 Nov through 1 December] (:froydnj) from comment #1)
> Thinking about this a little more, we have a raft of 16-bit character
> methods on nsString...are none of them applicable here?

There is a wwc function in nsString.h which is doing a cast from char16_t* to wchar_t*.
The problem about wwc is that it's available only in nsString.h, which is used for internal string headers only. We have tests depending on FileUtilsWin.h and they don't use nsString.h, so they wouldn't build with wwc used.
You need to log in before you can comment on or make changes to this bug.