[vlc-commits] Handle NPP_GetMIMEDescription having different return types

Rafaël Carré git at videolan.org
Sun Nov 13 21:14:39 CET 2011


npapi-vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Nov 13 15:14:07 2011 -0500| [a9aa594f5101f550e03c31da899c6c1968fb1e00] | committer: Rafaël Carré

Handle NPP_GetMIMEDescription having different return types

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=a9aa594f5101f550e03c31da899c6c1968fb1e00
---

 configure.ac             |   20 ++++++++++++++++++++
 npapi/support/npunix.cpp |    7 ++++---
 npapi/support/npwin.cpp  |    6 +++++-
 npapi/vlcshell.cpp       |    7 ++++++-
 npapi/vlcshell.h         |    6 +++++-
 5 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index d8e9a95..653b2ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,6 +195,26 @@ AC_CHECK_HEADERS(npruntime.h, [
   ]
 )
 
+AC_MSG_CHECKING([if NPP_GetMIMEDescription() returns const])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+   #ifdef WIN32
+   # define XP_WIN 1
+   #else
+   # ifdef __APPLE__
+   #  define XP_MACOSX 1
+   # endif
+   # define XP_UNIX 1
+   #endif
+   #include <npapi.h>
+  const char *NPP_GetMIMEDescription(void);
+])],[
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(NPP_GET_MIME_CONST, [const], [Wether NPP_GetMIMEDescription returns const])
+],[
+  AC_MSG_RESULT(no)
+  AC_DEFINE(NPP_GET_MIME_CONST, [], [Wether NPP_GetMIMEDescription returns const])
+])
+
 AC_LANG_POP(C++)
 
 
diff --git a/npapi/support/npunix.cpp b/npapi/support/npunix.cpp
index 0f824fa..de3e3c0 100644
--- a/npapi/support/npunix.cpp
+++ b/npapi/support/npunix.cpp
@@ -43,7 +43,9 @@
  *----------------------------------------------------------------------
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #define XP_UNIX 1
 
@@ -767,8 +769,7 @@ Private_GetJavaClass(void)
  *  - Netscape uses the return value to identify when an object instance
  *    of this plugin should be created.
  */
-const char *
-NP_GetMIMEDescription(void)
+NPP_GET_MIME_CONST char * NP_GetMIMEDescription(void)
 {
     return NPP_GetMIMEDescription();
 }
diff --git a/npapi/support/npwin.cpp b/npapi/support/npwin.cpp
index 29a53e1..7fe6d31 100644
--- a/npapi/support/npwin.cpp
+++ b/npapi/support/npwin.cpp
@@ -28,6 +28,10 @@
 
 //#define OJI 1
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include "../vlcplugin.h"
 
 #ifndef _NPAPI_H_
@@ -182,7 +186,7 @@ NP_Shutdown()
     return NPERR_NO_ERROR;
 }
 
-const char * NP_GetMIMEDescription()
+NPP_GET_MIME_CONST char * NP_GetMIMEDescription()
 {
   return NPP_GetMIMEDescription();
 }
diff --git a/npapi/vlcshell.cpp b/npapi/vlcshell.cpp
index 1a02c73..f6d55a3 100644
--- a/npapi/vlcshell.cpp
+++ b/npapi/vlcshell.cpp
@@ -25,6 +25,11 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -64,7 +69,7 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa
 /******************************************************************************
  * UNIX-only API calls
  *****************************************************************************/
-const char * NPP_GetMIMEDescription( void )
+NPP_GET_MIME_CONST char * NPP_GetMIMEDescription( void )
 {
     return mimetype;
 }
diff --git a/npapi/vlcshell.h b/npapi/vlcshell.h
index 07bf4a9..c8d471e 100644
--- a/npapi/vlcshell.h
+++ b/npapi/vlcshell.h
@@ -24,7 +24,11 @@
 #ifndef __VLCSHELL_H__
 #define __VLCSHELL_H__
 
-const char * NPP_GetMIMEDescription( void );
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+NPP_GET_MIME_CONST char * NPP_GetMIMEDescription( void );
 
 NPError NPP_Initialize( void );
 



More information about the vlc-commits mailing list