Fixing 73436 -- hiding platform specific calls in xp files, not part of the build, r=peterl

This commit is contained in:
av%netscape.com 2001-08-18 00:13:37 +00:00
parent ded89f6ae2
commit c8b65d16de
3 changed files with 18 additions and 3 deletions

View File

@ -76,15 +76,15 @@ NPError NPP_New(NPMIMEType pluginType,
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
} }
NP_GETENTRYPOINTS real_NP_GetEntryPoints = (NP_GETENTRYPOINTS)GetProcAddress(hLib, "NP_GetEntryPoints"); NP_GETENTRYPOINTS real_NP_GetEntryPoints = (NP_GETENTRYPOINTS)XP_GetSymbol(hLib, "NP_GetEntryPoints");
if(!real_NP_GetEntryPoints) if(!real_NP_GetEntryPoints)
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
NP_INITIALIZE real_NP_Initialize = (NP_INITIALIZE)GetProcAddress(hLib, "NP_Initialize"); NP_INITIALIZE real_NP_Initialize = (NP_INITIALIZE)XP_GetSymbol(hLib, "NP_Initialize");
if(!real_NP_Initialize) if(!real_NP_Initialize)
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;
NP_SHUTDOWN real_NP_Shutdown = (NP_SHUTDOWN)GetProcAddress(hLib, "NP_Shutdown"); NP_SHUTDOWN real_NP_Shutdown = (NP_SHUTDOWN)XP_GetSymbol(hLib, "NP_Shutdown");
if(!real_NP_Shutdown) if(!real_NP_Shutdown)
return NPERR_GENERIC_ERROR; return NPERR_GENERIC_ERROR;

View File

@ -23,6 +23,8 @@
#include "xp.h" #include "xp.h"
// file utils
BOOL XP_IsFile(char * szFileName) BOOL XP_IsFile(char * szFileName)
{ {
#ifdef XP_WIN #ifdef XP_WIN
@ -100,3 +102,12 @@ void XP_FlushFileBuffers(XP_HFILE hFile)
fflush(hFile); fflush(hFile);
#endif #endif
} }
// misc utils
void * XP_GetSymbol(XP_HLIB hLib, char * szProcName)
{
#ifdef XP_WIN
return (void *)GetProcAddress(hLib, szProcName);
#endif
}

View File

@ -137,4 +137,8 @@ void XP_DeleteFile(char * szFileName);
DWORD XP_WriteFile(XP_HFILE hFile, void * pBuf, int iSize); DWORD XP_WriteFile(XP_HFILE hFile, void * pBuf, int iSize);
void XP_FlushFileBuffers(XP_HFILE hFile); void XP_FlushFileBuffers(XP_HFILE hFile);
// misc
void * XP_GetSymbol(XP_HLIB hLib, char * szProcName);
#endif #endif