Use JS_FRIEND_DATA only on global variable declarations, not on their instances, to fix compilation with mingw.

RESOLVED DUPLICATE of bug 1019003

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 1019003
4 years ago
4 years ago

People

(Reporter: Jacek Caban, Assigned: Jacek Caban)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
It seems like GCC can't handle dllimport in this case and I get errors like:

0:02.30 /home/jacek/mozilla/mozilla-central/js/src/vm/TypedArrayObject.cpp:2098:37: error: external linkage required for symbol ‘js::detail::Int8ArrayClassPtr’ because of ‘dllexport’ attribute
 0:02.30  IMPL_TYPED_ARRAY_JSAPI_CONSTRUCTORS(Int8, int8_t)
 0:02.30                                      ^
 0:02.30 /home/jacek/mozilla/mozilla-central/js/src/vm/TypedArrayObject.cpp:2095:54: note: in definition of macro ‘IMPL_TYPED_ARRAY_JSAPI_CONSTRUCTORS’
 0:02.30    JS_FRIEND_DATA(const js::Class* const) js::detail::Name ## ArrayClassPtr =                    \
 0:02.30                                                       ^
 0:02.30 /home/jacek/mozilla/mozilla-central/js/src/vm/TypedArrayObject.cpp:2099:37: error: external linkage required for symbol ‘js::detail::Uint8ArrayClassPtr’ because of ‘dllexport’ attribute
 0:02.30  IMPL_TYPED_ARRAY_JSAPI_CONSTRUCTORS(Uint8, uint8_t)

Having the attribute on extern declaration should be enough.
(Assignee)

Updated

4 years ago
Attachment #8432427 - Flags: review?(jwalden+bmo)
You have the chronologically older bug.  But in finally getting to reviewing patches after a long deviation into security work, I picked up bug 1019003's review first, which makes this a dup.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1019003
Comment on attachment 8432427 [details] [diff] [review]
fix

Review of attachment 8432427 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for the duplication of effort here.  :-(
Attachment #8432427 - Flags: review?(jwalden+bmo)
You need to log in before you can comment on or make changes to this bug.