From adf513119094873526dd0386aa3a431069e2d340 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 24 Apr 2012 16:44:17 +0000 Subject: [PATCH] version issues with xulrunner api --- direct/src/plugin_npapi/startup.cxx | 8 ++++++-- direct/src/plugin_npapi/startup.h | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/direct/src/plugin_npapi/startup.cxx b/direct/src/plugin_npapi/startup.cxx index bb4eeec3a2..cf8fb6db9f 100644 --- a/direct/src/plugin_npapi/startup.cxx +++ b/direct/src/plugin_npapi/startup.cxx @@ -116,9 +116,13 @@ open_logfile() { // get the mimetypes and extensions this plugin is // supposed to handle. //////////////////////////////////////////////////////////////////// -const char* +#if NP_VERSION_MAJOR == 0 && NP_VERSION_MINOR <= 22 +char * +#else +const char * +#endif NP_GetMIMEDescription(void) { - return (const char*) "application/x-panda3d:p3d:Panda3D applet;"; + return "application/x-panda3d:p3d:Panda3D applet;"; } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/plugin_npapi/startup.h b/direct/src/plugin_npapi/startup.h index 959f139281..e8b9162a04 100644 --- a/direct/src/plugin_npapi/startup.h +++ b/direct/src/plugin_npapi/startup.h @@ -29,7 +29,13 @@ extern "C" { NPPluginFuncs *pluginFuncs); #endif - const char* NP_GetMIMEDescription(void); +#if NP_VERSION_MAJOR == 0 && NP_VERSION_MINOR <= 22 + // Until at least 0.22, this function was declared to return a char *. + char *NP_GetMIMEDescription(void); +#else + // At some point after 0.22, it was corrected to return a const char *. + const char *NP_GetMIMEDescription(void); +#endif NPError NP_GetValue(void*, NPPVariable variable, void* value); NPError OSCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); NPError OSCALL NP_Shutdown(void);