Open
Bug 701522
Opened 13 years ago
Updated 2 years ago
nsAString.h's kNotFound conflicts with LevelDB
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
NEW
People
(Reporter: mattm, Unassigned)
References
()
Details
Attachments
(1 file)
831 bytes,
patch
|
Details | Diff | Splinter Review |
I am working on integrating LevelDB (bug 679852).
The "#define kNotFound -1" conflicts with an element of an enum in LevelDB.
If nsAString.h is #included before any LevelDB headers, at best we get a compile error (Because enum Code { ..., -1 = 1, ...}; is invalid syntax).
At worst, somebody in the leveldb:: namespace who uses kNotFound compares against -1 instead of 1, leading to incorrect behaviour.
Correct use of #undef kNotFound before #including LevelDB headers avoids this problem, however it may lead to future problems.
One possibility is changing nsAString.h. That's what this bug is for.
Comment 1•13 years ago
|
||
Looks like we could probably change that to const PRInt32 kNotFound = -1;
Comment 2•13 years ago
|
||
Or even to a static member on nsAString, and fix our consumers.
Reporter | ||
Comment 3•13 years ago
|
||
Seems to build on Linux, at least. Pushing to try to find out what happens.
Comment 4•13 years ago
|
||
Try run for 7b687eed8c27 is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=7b687eed8c27
Results (out of 209 total builds):
success: 190
warnings: 18
failure: 1
Builds available at http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/mmcpherrin@mozilla.com-7b687eed8c27
Comment 5•13 years ago
|
||
I've been working on a patch to make nsAString::kNotFound instead of a global, which I think is preferable but requires some treewide changes.
Comment 6•12 years ago
|
||
I'm not going to have the time to finish what I started here. If there's a simpler patch and this is still an issue we can probably take that.
Assignee | ||
Updated•4 years ago
|
Component: String → XPCOM
Updated•2 years ago
|
Severity: minor → S4
You need to log in
before you can comment on or make changes to this bug.
Description
•