Changeset 83957 in webkit


Ignore:
Timestamp:
Apr 15, 2011 12:55:47 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-15 Ben Taylor <bentaylor.solx86@gmail.com>

Reviewed by Alexey Proskuryakov.

Fix building with Sun Studio 12: function pointers for extern "C" are treated differently
https://bugs.webkit.org/show_bug.cgi?id=58508

Since extern "C" makes a different type (although most compilers ignore that),
we should be more careful when passing NPAPI callback functions.

  • plugins/npapi.cpp: (NPN_PluginThreadAsyncCall):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83955 r83957  
     12011-04-15  Ben Taylor  <bentaylor.solx86@gmail.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Fix building with Sun Studio 12: function pointers for extern "C" are treated differently
     6        https://bugs.webkit.org/show_bug.cgi?id=58508
     7
     8        Since extern "C" makes a different type (although most compilers ignore that),
     9        we should be more careful when passing NPAPI callback functions.
     10
     11        * plugins/npapi.cpp:
     12        (NPN_PluginThreadAsyncCall):
     13
    1142011-04-15  Adam Barth  <abarth@webkit.org>
    215
  • trunk/Source/WebCore/plugins/npapi.cpp

    r69808 r83957  
    172172}
    173173
    174 void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)
     174extern "C" typedef void PluginThreadAsyncCallFunction(void*);
     175void NPN_PluginThreadAsyncCall(NPP instance, PluginThreadAsyncCallFunction func, void* userData)
    175176{
    176     PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData);
     177    // Callback function type only differs from MainThreadFunction by being extern "C", which doesn't affect calling convention on any compilers we use.
     178    PluginMainThreadScheduler::scheduler().scheduleCall(instance, reinterpret_cast<PluginMainThreadScheduler::MainThreadFunction*>(func), userData);
    177179}
    178180
Note: See TracChangeset for help on using the changeset viewer.