Skip to content

Commit

Permalink
Handle NPP_GetMIMEDescription having different return types
Browse files Browse the repository at this point in the history
  • Loading branch information
funman committed Nov 13, 2011
1 parent b002d8a commit a9aa594
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
20 changes: 20 additions & 0 deletions configure.ac
Expand Up @@ -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++)


Expand Down
7 changes: 4 additions & 3 deletions npapi/support/npunix.cpp
Expand Up @@ -43,7 +43,9 @@
*----------------------------------------------------------------------
*/

#include "config.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#define XP_UNIX 1

Expand Down Expand Up @@ -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();
}
Expand Down
6 changes: 5 additions & 1 deletion npapi/support/npwin.cpp
Expand Up @@ -28,6 +28,10 @@

//#define OJI 1

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include "../vlcplugin.h"

#ifndef _NPAPI_H_
Expand Down Expand Up @@ -182,7 +186,7 @@ NP_Shutdown()
return NPERR_NO_ERROR;
}

const char * NP_GetMIMEDescription()
NPP_GET_MIME_CONST char * NP_GetMIMEDescription()
{
return NPP_GetMIMEDescription();
}
Expand Down
7 changes: 6 additions & 1 deletion npapi/vlcshell.cpp
Expand Up @@ -25,6 +25,11 @@
/*****************************************************************************
* Preamble
*****************************************************************************/

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 5 additions & 1 deletion npapi/vlcshell.h
Expand Up @@ -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 );

Expand Down

0 comments on commit a9aa594

Please sign in to comment.