Closed Bug 957356 Opened 10 years ago Closed 10 years ago

Use the correct string type for expat's XML_Char depending on the language to use

Categories

(Core :: DOM: HTML Parser, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

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

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Attached patch Patch (v1)Splinter Review
Expat includes some C code in its implementation, but it's usage from our code is all in C++ code.  We would like to restrict the char16_t type to C++ code only, and this is the only place in our code base which we seem to be unintentionally using it in C code.

Since there is no good type which we can currently use for both C and C++, let's do this ugly hack of using uint16_t in C which is binary compatible.  The reason we cannot use wchar_t here is that in mingw, wchar_t is 4 bytes, which is not binary compatible with char16_t.

This patch also removes the currently broken XML_L macro.  The only usage of that macro is in xmlparse.c which is #if 0'ed out.  So hopefully that's fine.
Attachment #8356834 - Flags: review?(hsivonen)
Blocks: 957358
Assignee: nobody → ehsan
Comment on attachment 8356834 [details] [diff] [review]
Patch (v1)

This looks OK to me (though I don't understand why char16_t wouldn't work in C), but I'm not officially a module owner or peer for this code.
Attachment #8356834 - Flags: review?(hsivonen) → review+
https://hg.mozilla.org/mozilla-central/rev/c8d90c7a9ebe
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.