home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
watcom.dif
< prev
next >
Wrap
Text File
|
1997-03-17
|
8KB
|
210 lines
This is a set of edits necessary to make the NPDRAW plugin example
compile with the Borland 2.0 and Watcom 10.6 compilers.
Using these edits I was able to successfully run the draw.htm
test sample.
Kenneth Porter 72420.2436@compuserve.com
diff -w common/original/npos2.cpp common/npos2.cpp
16a17,19
> #if defined(__BORLANDC__) || defined(__WATCOMC__)
> #define NP_EXPORT __export
> #else
17a21
> #endif
30a35,46
> // [KAP] Borland uses different entry point
>
> #if defined(__BORLANDC__)
> extern int _multidll = 0; // tell the runtime library to init itself
> ULONG _dllmain(ULONG termflag, HMODULE modhandle)
> {
> (void) termflag;
> (void) modhandle;
> return TRUE; /* success */
> }
> #elif !defined(__WATCOMC__) // no init needed for Watcom
> // init routine for IBM
35c51
<
---
> #endif
diff include/original/npapi.h include/npapi.h
382a383,386
> #if defined(__BORLANDC__) || defined(__WATCOMC__)
> #define NP_LOADDS __syscall
> #define PNP_LOADDS NP_LOADDS *
> #else
383a388,389
> #define PNP_LOADDS * NP_LOADDS
> #endif
diff include/original/npupp.h include/npupp.h
115c115
< typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
---
> typedef NPError (PNP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
141c141
< typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
---
> typedef NPError (PNP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
168c168
< typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
---
> typedef NPError (PNP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
197c197
< typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
---
> typedef NPError (PNP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
224c224
< typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
---
> typedef NPError (PNP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
251c251
< typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
---
> typedef int32 (PNP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
281c281
< typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
---
> typedef int32 (PNP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
309c309
< typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
---
> typedef void (PNP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
335c335
< typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
---
> typedef void (PNP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
362c362
< typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
---
> typedef int16 (PNP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
391c391
< typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
---
> typedef void (PNP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
426c426
< typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
---
> typedef NPError (PNP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
456c456
< typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
---
> typedef NPError (PNP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
486c486
< typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
---
> typedef NPError (PNP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
512c512
< typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
---
> typedef NPError (PNP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
541c541
< typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
---
> typedef NPError (PNP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
567c567
< typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
---
> typedef NPError (PNP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
596c596
< typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
---
> typedef NPError (PNP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
625c625
< typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
---
> typedef int32 (PNP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
653c653
< typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
---
> typedef NPError (PNP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
680c680
< typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
---
> typedef void (PNP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
706c706
< typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
---
> typedef const char* (PNP_LOADDS NPN_UserAgentUPP)(NPP instance);
732c732
< typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
---
> typedef void* (PNP_LOADDS NPN_MemAllocUPP)(uint32 size);
758c758
< typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
---
> typedef void (PNP_LOADDS NPN_MemFreeUPP)(void* ptr);
785c785
< typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
---
> typedef uint32 (PNP_LOADDS NPN_MemFlushUPP)(uint32 size);
813c813
< typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
---
> typedef void (PNP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
840c840
< typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
---
> typedef JRIEnv* (PNP_LOADDS NPN_GetJavaEnvUPP)(void);
867c867
< typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
---
> typedef jref (PNP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
977c977
< #define OSCALL _System
---
> #define OSCALL NP_LOADDS
diff sample/npdraw/original/gendata.cpp sample/npdraw/gendata.cpp
25c25
< main(int argc, char *argv[])
---
> int main(int argc, char *argv[])
60a61
> return 0;
diff sample/npdraw/original/npdraw.cpp sample/npdraw/npdraw.cpp
26a27,33
> #if defined(__BORLANDC__)
> #include <cstring.h>
> #define IString string
> #elif defined(__WATCOMC__)
> #include <string.hpp>
> #define IString String
> #else
27a35,36
> #endif
>
63a73,74
> #if !defined(__BORLANDC__) && !defined(__WATCOMC__)
>
92c103
< static void _System cleanup(ULONG ulReason);
---
> static void NP_LOADDS cleanup(ULONG ulReason);
109c120
< unsigned long _System _DLL_InitTerm(unsigned long hModule, unsigned long
---
> unsigned long NP_LOADDS _DLL_InitTerm(unsigned long hModule, unsigned long
150c161
< static void cleanup(ULONG ulReason)
---
> static void NP_LOADDS cleanup(ULONG ulReason)
158a170,171
> #endif // !defined(__BORLANDC__) && !defined(__WATCOMC__)
>
198c211
< NPError NPP_Initialize(void)
---
> NPError NP_LOADDS NPP_Initialize(void)
209c222
< void NPP_Shutdown(void)
---
> void NP_LOADDS NPP_Shutdown(void)
247c260
< This->hps = NULL;
---
> This->hps = NULLHANDLE;
diff sample/npdraw/original/npdraw.def sample/npdraw/npdraw.def
10d9
< _DLL_InitTerm @4