[Webkit-unassigned] [Bug 58508] Fix linking with Sun Studio 12: function pointers for extern "C" are treated differently
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Apr 14 04:29:30 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=58508
--- Comment #4 from Ben Taylor <bentaylor.solx86 at gmail.com> 2011-04-14 04:29:30 PST ---
(In reply to comment #3)
> I don't understand why you had to wrap function body in extern "C". Its declaration already has extern "C", so the compiler knows that it has C linkage. Note that you didn't face a problem with NPN_ScheduleTimer, which also takes a function pointer.
>
> Would the following change alone do the trick?
>
> PluginMainThreadScheduler::scheduler().scheduleCall(instance, (MainThreadFunction)func, userData);
>
> And if that works, would a C++ style cast (probably a reinterpret_cast) work, too?
Here is the output from the compiler when we try your suggestion.
"plugins/npapi.cpp", line 175: Warning: function void(_NPP*,void(*)(void*),void*) overloads extern "C" void(_NPP*,extern "C" void(*)(void*),void*) because of different language linkages.
"plugins/npapi.cpp", line 176: Error: MainThreadFunction is not defined.
"plugins/npapi.cpp", line 176: Error: Badly formed expression.
Thoughts?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list