Fix Windows build of extensions

This commit is contained in:
Fridrich Strba 2011-11-08 06:23:07 -07:00 committed by Fridrich Štrba
parent f222b01170
commit 60de6b0fd2
5 changed files with 32 additions and 34 deletions

View file

@ -73,23 +73,21 @@
//http://qa.openoffice.org/issues/show_bug.cgi?id=82545
//https://bugzilla.mozilla.org/show_bug.cgi?id=241262
#ifdef UNIX
# ifndef _UINT32
# if defined(__alpha) || defined(__LP64__) || defined(AIX)
typedef unsigned int uint32;
# else /* __alpha */
typedef unsigned long uint32;
# endif
# define _UINT32
#ifndef _UINT32
# if defined(__alpha) || defined(__LP64__) || defined(AIX) || defined(WNT)
typedef unsigned int uint32;
# else /* __alpha */
typedef unsigned long uint32;
# endif
# ifndef _INT32
# if defined(__alpha) || defined(__LP64__) || defined(AIX)
typedef int int32;
# else /* __alpha */
typedef long int32;
# endif
# define _INT32
# define _UINT32
#endif
#ifndef _INT32
# if defined(__alpha) || defined(__LP64__) || defined(AIX) || defined(WNT)
typedef int int32;
# else /* __alpha */
typedef long int32;
# endif
# define _INT32
#endif
#include "npapi.h"

View file

@ -1085,7 +1085,7 @@ void PluginInputStream::writeBytes( const Sequence<sal_Int8>& Buffer ) throw()
m_aFileStream.Seek( m_nWritePos );
nBytes = m_aFileStream.Read( pBuffer, nBytes );
int32 nBytesRead = 0;
int32_t nBytesRead = 0;
try
{
nBytesRead = m_pPlugin->getPluginComm()->NPP_Write(

View file

@ -72,9 +72,9 @@ public:
const char* fname ) = 0;
virtual void NPP_URLNotify( NPP instance, const char* url,
NPReason reason, void* notifyData ) = 0;
virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset,
int32 len, void* buffer ) = 0;
virtual int32 NPP_WriteReady( NPP instance, NPStream* stream ) = 0;
virtual int32_t NPP_Write( NPP instance, NPStream* stream, int32_t offset,
int32_t len, void* buffer ) = 0;
virtual int32_t NPP_WriteReady( NPP instance, NPStream* stream ) = 0;
virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void* value ) = 0;
virtual NPError NPP_SetValue( NPP instance, NPNVariable variable,
void *value) = 0;

View file

@ -87,10 +87,10 @@ public:
virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream, NPError reason );
virtual void * NPP_GetJavaClass();
virtual NPError NPP_Initialize();
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char* argn[], char* argv[], NPSavedData *saved );
virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16* stype );
NPBool seekable, uint16_t* stype );
virtual void NPP_Print( NPP instance, NPPrint* platformPrint );
using PluginComm::NPP_SetWindow;
@ -99,9 +99,9 @@ public:
virtual void NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname );
virtual void NPP_URLNotify( NPP instance, const char* url,
NPReason reason, void* notifyData );
virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset,
int32 len, void* buffer );
virtual int32 NPP_WriteReady( NPP instance, NPStream* stream );
virtual int32_t NPP_Write( NPP instance, NPStream* stream, int32_t offset,
int32_t len, void* buffer );
virtual int32_t NPP_WriteReady( NPP instance, NPStream* stream );
virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void *ret_alue );
virtual NPError NPP_SetValue( NPP instance, NPNVariable variable, void *ret_alue );

View file

@ -174,8 +174,8 @@ long PluginComm_Impl::doIt()
? (*_NPPfuncs.newp)(
(NPMIMEType)m_aArgs[0],
(NPP)m_aArgs[1],
(uint16)(sal_IntPtr)m_aArgs[2],
(int16)(sal_IntPtr)m_aArgs[3],
(uint16_t)(sal_IntPtr)m_aArgs[2],
(int16_t)(sal_IntPtr)m_aArgs[3],
(char**)m_aArgs[4],
(char**)m_aArgs[5],
(NPSavedData*)m_aArgs[6] )
@ -189,7 +189,7 @@ long PluginComm_Impl::doIt()
(NPMIMEType)m_aArgs[1],
(NPStream*)m_aArgs[2],
(NPBool)(sal_IntPtr)m_aArgs[3],
(uint16*)m_aArgs[4] )
(uint16_t*)m_aArgs[4] )
: NPERR_GENERIC_ERROR);
break;
case eNPP_Print:
@ -227,13 +227,13 @@ long PluginComm_Impl::doIt()
m_aArgs[3] );
break;
case eNPP_Write:
TRACEN( "eNPP_Write n=", (int32)m_aArgs[3] );
TRACEN( "eNPP_Write n=", (int32_t)m_aArgs[3] );
nRet = (_NPPfuncs.write
? (*_NPPfuncs.write)(
(NPP)m_aArgs[0],
(NPStream*)m_aArgs[1],
(int32)m_aArgs[2],
(int32)m_aArgs[3],
(int32_t)m_aArgs[2],
(int32_t)m_aArgs[3],
m_aArgs[4] )
: 0);
break;
@ -305,7 +305,7 @@ NPError PluginComm_Impl::NPP_DestroyStream( NPP instance, NPStream* stream, NPEr
}
//--------------------------------------------------------------------------------------------------
NPError PluginComm_Impl::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
NPError PluginComm_Impl::NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char* argn[], char* argv[], NPSavedData *saved )
{
DBG_ASSERT( _NPPfuncs.newp, "### NPP_New(): null pointer in NPP functions table!" );
@ -322,7 +322,7 @@ NPError PluginComm_Impl::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mo
//--------------------------------------------------------------------------------------------------
NPError PluginComm_Impl::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16* stype )
NPBool seekable, uint16_t* stype )
{
DBG_ASSERT( _NPPfuncs.newstream, "### NPP_NewStream(): null pointer in NPP functions table!" );
m_eCall = eNPP_NewStream;
@ -378,7 +378,7 @@ void PluginComm_Impl::NPP_URLNotify( NPP instance, const char* url, NPReason rea
}
//--------------------------------------------------------------------------------------------------
int32 PluginComm_Impl::NPP_Write( NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer )
int32_t PluginComm_Impl::NPP_Write( NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer )
{
DBG_ASSERT( _NPPfuncs.write, "### NPP_Write(): null pointer in NPP functions table!" );
m_eCall = eNPP_Write;
@ -391,7 +391,7 @@ int32 PluginComm_Impl::NPP_Write( NPP instance, NPStream* stream, int32 offset,
}
//--------------------------------------------------------------------------------------------------
int32 PluginComm_Impl::NPP_WriteReady( NPP instance, NPStream* stream )
int32_t PluginComm_Impl::NPP_WriteReady( NPP instance, NPStream* stream )
{
DBG_ASSERT( _NPPfuncs.writeready, "### NPP_WriteReady(): null pointer in NPP functions table!" );
m_eCall = eNPP_WriteReady;