Bug 532605 - _write conflicts with symbols in the MSVC runtime. Remove all vestiges of PR_BEGIN_EXTERN_C from nsNPAPIPlugin.{h,cpp}, so that these functions are given C++ mangled names in the namespace we actually declared for them.
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 03 Dec 2009 09:17:49 -0500
changeset 36141 2829e0190d535f8c43ab9739e5228fe8197896c3
parent 36140 7ebfbec7521c2e98786bad0d0f00720f2bb2d3e1
child 36142 080b011ab3e42daca9d9e27e879157750cece426
push idunknown
push userunknown
push dateunknown
bugs532605
milestone1.9.3a1pre
Bug 532605 - _write conflicts with symbols in the MSVC runtime. Remove all vestiges of PR_BEGIN_EXTERN_C from nsNPAPIPlugin.{h,cpp}, so that these functions are given C++ mangled names in the namespace we actually declared for them.
modules/plugin/base/src/nsNPAPIPlugin.cpp
modules/plugin/base/src/nsNPAPIPlugin.h
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -2603,29 +2603,25 @@ NPError NP_CALLBACK
   *ulen = *username ? uname8.Length() : 0;
 
   *password = ToNewCString(pwd8);
   *plen = *password ? pwd8.Length() : 0;
 
   return NPERR_NO_ERROR;
 }
 
-// We need extern "C" here because it has a function pointer as an argument.
-// See Bug 501889.
-PR_BEGIN_EXTERN_C
 uint32_t NP_CALLBACK
 _scheduletimer(NPP instance, uint32_t interval, NPBool repeat, PluginTimerFunc timerFunc)
 {
   nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
   if (!inst)
     return 0;
 
   return inst->ScheduleTimer(interval, repeat, timerFunc);
 }
-PR_END_EXTERN_C
 
 void NP_CALLBACK
 _unscheduletimer(NPP instance, uint32_t timerID)
 {
   nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
   if (!inst)
     return;
 
--- a/modules/plugin/base/src/nsNPAPIPlugin.h
+++ b/modules/plugin/base/src/nsNPAPIPlugin.h
@@ -111,18 +111,16 @@ protected:
   // Browser-side callbacks that the plugin calls.
   static NPNetscapeFuncs CALLBACKS;
 };
 
 namespace mozilla {
 namespace plugins {
 namespace parent {
 
-PR_BEGIN_EXTERN_C
-
 NPObject* NP_CALLBACK
 _getwindowobject(NPP npp);
 
 NPObject* NP_CALLBACK
 _getpluginelement(NPP npp);
 
 NPIdentifier NP_CALLBACK
 _getstringidentifier(const NPUTF8* name);
@@ -296,18 +294,16 @@ void* NP_CALLBACK
 
 // Deprecated entry points for the old Java plugin.
 void* NP_CALLBACK /* OJI type: JRIEnv* */
 _getJavaEnv(void);
 
 void* NP_CALLBACK /* OJI type: jref */
 _getJavaPeer(NPP npp);
 
-PR_END_EXTERN_C
-
 } /* namespace parent */
 } /* namespace plugins */
 } /* namespace mozilla */
 
 const char *
 PeekException();
 
 void