diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-23 09:26:22 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-09-04 10:41:00 (GMT) |
commit | ec0ce28dd0a0a6c67ffd5ef166978f0ec0f95894 (patch) | |
tree | da89a6fc51810a46b54a1612ecd4430282ecd5db /src/3rdparty | |
parent | fd348f0cc28db4a20b06102b419139c0f1473aec (diff) | |
download | Qt-ec0ce28dd0a0a6c67ffd5ef166978f0ec0f95894.zip Qt-ec0ce28dd0a0a6c67ffd5ef166978f0ec0f95894.tar.gz Qt-ec0ce28dd0a0a6c67ffd5ef166978f0ec0f95894.tar.bz2 |
Fix linking with Sun CC 5.9: function pointers for extern "C" are treated differently
The Sun CC compiler treats C functions and C++ functions differently,
as if they had a different calling sequence (they don't, but they
could). So if you declare a function in C++ having a function pointer
as a parameter, it's understood to be C++ even if it had previously
been declared as extern "C".
This could be a compiler error, though. In any case, the end result is
that WebKit fails to link because of an undefined reference to
NPN_PluginThreadAsyncCall.
"plugins/npapi.cpp", line 177: Warning (Anachronism): Formal argument 2 of type void(*)(void*) in call to WebCore::PluginMainThreadScheduler::scheduleCall(_NPP*, void(*)(void*), void*) is being passed extern "C" void(*)(void*).
There are more of these errors left in WebKit, but they are not
causing problems right now.
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h | 4 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebCore/plugins/npapi.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h b/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h index 01ce804..b8305b5 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h @@ -34,7 +34,9 @@ namespace WTF { class Mutex; -typedef void MainThreadFunction(void*); +extern "C" { + typedef void MainThreadFunction(void*); +} void callOnMainThread(MainThreadFunction*, void* context); diff --git a/src/3rdparty/webkit/WebCore/plugins/npapi.cpp b/src/3rdparty/webkit/WebCore/plugins/npapi.cpp index 4135b64..d275a39 100644 --- a/src/3rdparty/webkit/WebCore/plugins/npapi.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/npapi.cpp @@ -171,7 +171,9 @@ void NPN_PopPopupsEnabledState(NPP instance) pluginViewForInstance(instance)->popPopupsEnabledState(); } +extern "C" { void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData) { PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData); } +} |