From: <br...@us...> - 2012-04-23 06:19:46
|
Revision: 4247 http://openvrml.svn.sourceforge.net/openvrml/?rev=4247&view=rev Author: braden Date: 2012-04-23 06:19:36 +0000 (Mon, 23 Apr 2012) Log Message: ----------- NP[P]_GetMIMEDescription returns const char * in recent variations of NPAPI. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac trunk/src/mozilla-plugin/openvrml.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-08-20 06:32:28 UTC (rev 4246) +++ trunk/ChangeLog 2012-04-23 06:19:36 UTC (rev 4247) @@ -1,3 +1,11 @@ +2012-04-23 Braden McDaniel <br...@en...> + + NP[P]_GetMIMEDescription returns const char * in recent variations of + NPAPI. + + * configure.ac + * src/mozilla-plugin/openvrml.cpp + 2011-08-20 Braden McDaniel <br...@en...> Define BOOST_FILESYSTEM_VERSION=3 for compatibility with Boost Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2011-08-20 06:32:28 UTC (rev 4246) +++ trunk/configure.ac 2012-04-23 06:19:36 UTC (rev 4247) @@ -288,13 +288,27 @@ [have_gnomeui=no]) PKG_CHECK_MODULES([GIO], [gio-2.0], , [have_gio=no]) PKG_CHECK_MODULES([CURL], [libcurl], , [have_libcurl=no]) -# -# The Mozilla plug-in uses the npfunctions.h header introduced in -# XULRunner 1.9.1. -# -PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 1.9.1], +PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 2], [have_mozilla_plugin=yes], [have_mozilla_plugin=no]) +AC_LANG_PUSH([C++]) +ov_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$MOZILLA_PLUGIN_CFLAGS $CPPFLAGS" +AC_CACHE_CHECK([if NP_GetMIMEDescription returns const char *], + [ov_cv_np_getmimedescription_const_char], +[ov_cv_np_getmimedescription_const_char=yes +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <npfunctions.h> +char * NP_GetMIMEDescription() { return 0; }]], + [])], + [ov_cv_np_getmimedescription_const_char=no])]) +CPPFLAGS=$ov_save_CPPFLAGS +AC_LANG_POP([C++]) +ov_np_getmimedescription_const= +AS_IF([test X$ov_cv_np_getmimedescription_const_char = Xyes], + [ov_np_getmimedescription_const=const]) +AC_DEFINE_UNQUOTED([OPENVRML_NP_GETMIMEDESCRIPTION_CONST], + [$ov_np_getmimedescription_const], + [const if NP_GetMIMEDescription returns const char *.]) AC_PATH_XTRA AX_CHECK_GLU Modified: trunk/src/mozilla-plugin/openvrml.cpp =================================================================== --- trunk/src/mozilla-plugin/openvrml.cpp 2011-08-20 06:32:28 UTC (rev 4246) +++ trunk/src/mozilla-plugin/openvrml.cpp 2012-04-23 06:19:36 UTC (rev 4247) @@ -215,7 +215,7 @@ { } -char * NP_GetMIMEDescription() +OPENVRML_NP_GETMIMEDESCRIPTION_CONST char * NP_GetMIMEDescription() { return NPP_GetMIMEDescription(); } @@ -380,13 +380,13 @@ return err; } -char * NPP_GetMIMEDescription() +OPENVRML_NP_GETMIMEDESCRIPTION_CONST char * NPP_GetMIMEDescription() { static const char mimeDescription[] = "model/x3d-vrml:x3dv:X3D world;" "model/vrml:wrl:VRML world;" "x-world/x-vrml:wrl:VRML world"; - return const_cast<char *>(&mimeDescription[0]); + return &mimeDescription[0]; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |