Closed
Bug 573004
Opened 14 years ago
Closed 14 years ago
jsctypes-test: test_closure_cdecl is mangled
Categories
(Core :: js-ctypes, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)
Details
Attachments
(1 file, 1 obsolete file)
1.63 KB,
patch
|
dwitte
:
review+
|
Details | Diff | Splinter Review |
With Sun Studio compiler, test_closure_cdecl() doesn't match the declaration in header. extern "C" functor vs. no extern "C" functor.
Attachment #452242 -
Flags: review?(dwitte)
Comment 2•14 years ago
|
||
I don't get it. http://mxr.mozilla.org/mozilla-central/source/toolkit/components/ctypes/tests/jsctypes-test.h#191 All the other functions are declared in the 'extern C' block in the header, and inherit that linkage when defined in the cpp. Why is this function different? If this is a bug in the Sun compiler, I'd suggest wrapping everything in the cpp in NS_EXTERN_C, to keep things consistent and unsurprising.
Comment 3•14 years ago
|
||
Also, I'm curious how it's mangled. What's the symbol name?
The mangled name is __1cStest_closure_cdecl6FWpFW_i_i_ Other functions don't use function pointer as a parameter. so ... A cleaner solution would be using typedef for the functor. Since it is only a test program, and the functor is only used here, I thought it might not be necessary.
Comment 5•14 years ago
|
||
Ah, got it. Anonymous function type. Yeah, let's typedef it.
Attachment #452242 -
Attachment is obsolete: true
Attachment #453688 -
Flags: review?(dwitte)
Attachment #452242 -
Flags: review?(dwitte)
Updated•14 years ago
|
Attachment #453688 -
Flags: review?(dwitte) → review+
Comment 7•14 years ago
|
||
Comment on attachment 453688 [details] [diff] [review] patch v2 >diff --git a/toolkit/components/ctypes/tests/jsctypes-test.cpp b/toolkit/components/ctypes/tests/jsctypes-test.cpp > #if defined(_WIN32) && !defined(_WIN64) > PRInt32 > test_closure_cdecl(PRInt8 i, PRInt32 (NS_STDCALL *f)(PRInt8)) > { Can you also typedef this pointer? Perhaps call it test_func_ptr_stdcall. >diff --git a/toolkit/components/ctypes/tests/jsctypes-test.h b/toolkit/components/ctypes/tests/jsctypes-test.h > #if defined(_WIN32) && !defined(_WIN64) > NS_EXPORT PRInt32 test_closure_stdcall(PRInt8, PRInt32 (NS_STDCALL *)(PRInt8)); > #endif /* defined(_WIN32) && !defined(_WIN64) */ (Declared here. Note: the declaration will have to be inside the #ifdef.) Thanks! r=dwitte.
http://hg.mozilla.org/mozilla-central/rev/234a06c6aab6
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•