Closed
Bug 1277624
Opened 8 years ago
Closed 8 years ago
fix misplaced declarations of mozilla::jni::Context<>::name for clang's benefit
Categories
(Core Graveyard :: Widget: Android, defect)
Tracking
(firefox49 affected, firefox50 fixed)
RESOLVED
FIXED
mozilla50
People
(Reporter: froydnj, Assigned: jchen)
References
Details
Attachments
(3 files)
5.97 KB,
patch
|
snorp
:
review+
|
Details | Diff | Splinter Review |
42.58 KB,
patch
|
jchen
:
review+
|
Details | Diff | Splinter Review |
3.95 KB,
patch
|
jchen
:
review+
|
Details | Diff | Splinter Review |
Generated Android bindings have code like: namespace mozilla { namespace widget { namespace sdk { template<> const char mozilla::jni::Context<Rect, jobject>::name[] = "android/graphics/Rect"; ... clang complains about this: /opt/build/froydnj/build-android/widget/android/bindings/AndroidRect.cpp:14:61: error: cannot define or redeclare 'name' here because namespace 'sdk' does not enclose namespace 'Context<mozilla::widget::sdk::Rect, _jobject *>' template<> const char mozilla::jni::Context<Rect, jobject>::name[] = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ /opt/build/froydnj/build-android/widget/android/bindings/AndroidRect.cpp:556:62: error: cannot define or redeclare 'name' here because namespace 'sdk' does not enclose namespace 'Context<mozilla::widget::sdk::RectF, _jobject *>' template<> const char mozilla::jni::Context<RectF, jobject>::name[] = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ So I guess we need to move these out a couple of levels.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•8 years ago
|
||
Move the class name strings into ObjectBase, so that the strings can be overridden by derived classes in other namespaces.
Attachment #8759731 -
Flags: review?(snorp)
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #8759732 -
Flags: review+
Assignee | ||
Comment 3•8 years ago
|
||
Trivial patch to not use anonymous namespace in headers, which can introduce multiple copies of the same code in different compilation units.
Attachment #8759733 -
Flags: review+
Reporter | ||
Comment 4•8 years ago
|
||
For the record, these patches do fix the compilation errors with clang.
Attachment #8759731 -
Flags: review?(snorp) → review+
Pushed by nchen@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/91ca677e4496 Move JNI class name out of Context; r=snorp https://hg.mozilla.org/integration/mozilla-inbound/rev/6f2a56ca83e7 Update auto-generated bindings; r=me https://hg.mozilla.org/integration/mozilla-inbound/rev/5c6ee7ceb0a9 Don't use anonymous namespace in headers; r=me
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(nchen)
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/91ca677e4496 https://hg.mozilla.org/mozilla-central/rev/6f2a56ca83e7 https://hg.mozilla.org/mozilla-central/rev/5c6ee7ceb0a9
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•