# HG changeset patch # User Jiri Vanek # Date 1324462662 -3600 # Node ID 77c2b187b88fdf6725c73f903bd25b68cda4028a # Parent 8cb4e38427cc65d1411f1e7460b3efe42a26a5b4 Made compatible with both xulrunner versions diff -r 8cb4e38427cc -r 77c2b187b88f ChangeLog --- a/ChangeLog Thu Dec 08 16:20:51 2011 -0500 +++ b/ChangeLog Wed Dec 21 11:17:42 2011 +0100 @@ -1,3 +1,13 @@ +2011-12-21 Jiri Vanek + + * acinclude.m4: added definition of IT_CHECK_XULRUNNER_API_VERSION, + which tries to compile small program against new xulrunner api + * configure.ac: added call of IT_CHECK_XULRUNNER_API_VERSION + * plugin/icedteanp/IcedTeaNPPlugin.cc: (NP_GetMIMEDescription) + return type set-up by dependency on defined LEGACY_XULRUNNERAPI. + This one is set by IT_CHECK_XULRUNNER_API_VERSION during configure. + if defined, then old char* is used. New const char* is used otherwise. + 2011-12-08 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java diff -r 8cb4e38427cc -r 77c2b187b88f acinclude.m4 --- a/acinclude.m4 Thu Dec 08 16:20:51 2011 -0500 +++ b/acinclude.m4 Wed Dec 21 11:17:42 2011 +0100 @@ -385,6 +385,26 @@ AC_SUBST(PKGVERSION) ]) +AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_API_VERSION], +[ + AC_MSG_CHECKING([for legacy xulrunner api]) + AC_LANG_PUSH(C++) + CXXFLAGS_BACKUP=$CXXFLAGS + CXXFLAGS=$CXXFLAGS" "$MOZILLA_CFLAGS + AC_TRY_COMPILE([ + #include + const char* NP_GetMIMEDescription () + {return (char*) "yap!";} + ],[],[ + AC_MSG_RESULT(no) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE([LEGACY_XULRUNNERAPI]) + ]) + CXXFLAGS=$CXXFLAGS_BACKUP + AC_LANG_POP(C++) +]) + AC_DEFUN([IT_CHECK_WITH_GCJ], [ AC_MSG_CHECKING([whether to compile ecj natively]) diff -r 8cb4e38427cc -r 77c2b187b88f configure.ac --- a/configure.ac Thu Dec 08 16:20:51 2011 -0500 +++ b/configure.ac Wed Dec 21 11:17:42 2011 +0100 @@ -78,5 +78,6 @@ IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.UrlUtil]) IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef]) IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE +IT_CHECK_XULRUNNER_API_VERSION AC_OUTPUT diff -r 8cb4e38427cc -r 77c2b187b88f plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Thu Dec 08 16:20:51 2011 -0500 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Dec 21 11:17:42 2011 +0100 @@ -2286,7 +2286,11 @@ // Returns a string describing the MIME type that this plugin // handles. -char* +#ifdef LEGACY_XULRUNNERAPI + char* +#else + const char* +#endif NP_GetMIMEDescription () { PLUGIN_DEBUG ("NP_GetMIMEDescription\n");