diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-02-21 16:56:10 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-02-21 17:22:02 +0100 |
commit | e6d0daefbdb8367384d8e5c217f65118bd8dc565 (patch) | |
tree | 919989cf378cbf13adf092763346bb8f59d993bc | |
parent | 46fd2a3bf2a53c64c040590afe450505fcb13c10 (diff) |
build also with older npapi
They were apparently lame enough to make a source-incompatible
change without changing API version or anything similar.
-rw-r--r-- | config_host.mk.in | 1 | ||||
-rw-r--r-- | configure.in | 20 | ||||
-rw-r--r-- | extensions/Library_npsoplugin.mk | 6 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/npshell.cxx | 5 |
4 files changed, 31 insertions, 1 deletions
diff --git a/config_host.mk.in b/config_host.mk.in index 3da38d9c3ad8..f0085ab218bd 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -188,6 +188,7 @@ export HAVE_GCC_VISIBILITY_FEATURE=@HAVE_GCC_VISIBILITY_FEATURE@ export HAVE_GETOPT=@HAVE_GETOPT@ export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@ export HAVE_LD_HASH_STYLE=@HAVE_LD_HASH_STYLE@ +export HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=@HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION@ export HAVE_POSIX_FALLOCATE=@HAVE_POSIX_FALLOCATE@ export HAVE_READDIR_R=@HAVE_READDIR_R@ export HAVE_THREADSAFE_STATICS=@HAVE_THREADSAFE_STATICS@ diff --git a/configure.in b/configure.in index c0995798fe22..22f6945fcfb4 100644 --- a/configure.in +++ b/configure.in @@ -7192,6 +7192,7 @@ AC_SUBST(NSS_LIBS) dnl =================================================================== dnl Check for system mozilla headers dnl =================================================================== +HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION= AC_MSG_CHECKING([which mozilla headers to use]) if test "$with_system_mozilla_headers" = "yes"; then AC_MSG_RESULT([external]) @@ -7206,12 +7207,31 @@ if test "$with_system_mozilla_headers" = "yes"; then if test "x$LOCATED" != "xyes"; then AC_MSG_ERROR([npapi.h header file not found]) fi + + AC_LANG_PUSH([C]) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $MOZILLA_HEADERS_CFLAGS" + AC_MSG_CHECKING([for NPP_GetMIMEDescription return type]) + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ + #define XP_UNIX + #include <npapi.h> + const char* NPP_GetMIMEDescription(void) { return "foo"; } + ]])], + [AC_MSG_RESULT([const char*])], + [ + AC_MSG_RESULT([char*]) + HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE + ]) + CFLAGS=$save_CFLAGS + AC_LANG_POP([C]) else AC_MSG_RESULT([internal]) SYSTEM_MOZILLA_HEADERS=NO fi AC_SUBST(MOZILLA_HEADERS_CFLAGS) AC_SUBST(SYSTEM_MOZILLA_HEADERS) +AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION) dnl =================================================================== dnl Check for system sane diff --git a/extensions/Library_npsoplugin.mk b/extensions/Library_npsoplugin.mk index 94d9d237bb06..3c6854692b23 100644 --- a/extensions/Library_npsoplugin.mk +++ b/extensions/Library_npsoplugin.mk @@ -48,6 +48,12 @@ $(eval $(call gb_Library_add_defs,npsoplugin,\ -DMOZ_X11 \ )) +ifeq ($(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION),TRUE) +$(eval $(call gb_Library_add_defs,npsoplugin,\ + -DHAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=1 \ +)) +endif + ifeq ($(filter-out LINUX FREEBSD NETBSD OPENBSD DRAGONFLY,$(OS)),) $(eval $(call gb_Library_add_defs,npsoplugin,\ -DNP_LINUX \ diff --git a/extensions/source/nsplugin/source/npshell.cxx b/extensions/source/nsplugin/source/npshell.cxx index 6d6122834ad2..83f2371602e8 100644 --- a/extensions/source/nsplugin/source/npshell.cxx +++ b/extensions/source/nsplugin/source/npshell.cxx @@ -361,7 +361,10 @@ MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII ":odp:OpenDocument Presentation;" MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII ":otp:OpenDocument Presentation Template;" MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII ":odf:OpenDocument Formula;" ); -const char* +#ifndef HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION +const +#endif +char* NPP_GetMIMEDescription(void) { debug_fprintf(NSP_LOG_APPEND, "print by Netscape Plugin, NPP_GetMIMEDescription:%s.\n", pMimeTypes); |