home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / watcom.dif < prev    next >
Text File  |  1997-03-17  |  8KB  |  210 lines

  1. This is a set of edits necessary to make the NPDRAW plugin example
  2. compile with the Borland 2.0 and Watcom 10.6 compilers.
  3. Using these edits I was able to successfully run the draw.htm
  4. test sample.
  5.  
  6. Kenneth Porter 72420.2436@compuserve.com
  7.  
  8. diff -w common/original/npos2.cpp common/npos2.cpp
  9. 16a17,19
  10. > #if defined(__BORLANDC__) || defined(__WATCOMC__)
  11. > #define NP_EXPORT __export
  12. > #else
  13. 17a21
  14. > #endif
  15. 30a35,46
  16. > // [KAP] Borland uses different entry point
  17. > #if defined(__BORLANDC__)
  18. > extern int _multidll = 0;   // tell the runtime library to init itself
  19. > ULONG _dllmain(ULONG termflag, HMODULE modhandle)
  20. > {
  21. >     (void) termflag;
  22. >     (void) modhandle;
  23. >     return TRUE;    /* success */
  24. > }
  25. > #elif !defined(__WATCOMC__) // no init needed for Watcom
  26. > // init routine for IBM
  27. 35c51
  28. ---
  29. > #endif
  30. diff include/original/npapi.h include/npapi.h
  31. 382a383,386
  32. > #if defined(__BORLANDC__) || defined(__WATCOMC__)
  33. > #define NP_LOADDS __syscall
  34. > #define PNP_LOADDS NP_LOADDS *
  35. > #else
  36. 383a388,389
  37. > #define PNP_LOADDS * NP_LOADDS
  38. > #endif
  39. diff include/original/npupp.h include/npupp.h
  40. 115c115
  41. < typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
  42. ---
  43. > typedef NPError (PNP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
  44. 141c141
  45. < typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
  46. ---
  47. > typedef NPError (PNP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
  48. 168c168
  49. < typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
  50. ---
  51. > typedef NPError (PNP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
  52. 197c197
  53. < typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
  54. ---
  55. > typedef NPError (PNP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
  56. 224c224
  57. < typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
  58. ---
  59. > typedef NPError (PNP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
  60. 251c251
  61. < typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
  62. ---
  63. > typedef int32 (PNP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
  64. 281c281
  65. < typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
  66. ---
  67. > typedef int32 (PNP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
  68. 309c309
  69. < typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
  70. ---
  71. > typedef void (PNP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
  72. 335c335
  73. < typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
  74. ---
  75. > typedef void (PNP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
  76. 362c362
  77. < typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
  78. ---
  79. > typedef int16 (PNP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
  80. 391c391
  81. < typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
  82. ---
  83. > typedef void (PNP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
  84. 426c426
  85. < typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
  86. ---
  87. > typedef NPError (PNP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
  88. 456c456
  89. < typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
  90. ---
  91. > typedef NPError (PNP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
  92. 486c486
  93. < typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
  94. ---
  95. > typedef NPError (PNP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData);
  96. 512c512
  97. < typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
  98. ---
  99. > typedef NPError (PNP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
  100. 541c541
  101. < typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
  102. ---
  103. > typedef NPError (PNP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file);
  104. 567c567
  105. < typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
  106. ---
  107. > typedef NPError (PNP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
  108. 596c596
  109. < typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
  110. ---
  111. > typedef NPError (PNP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
  112. 625c625
  113. < typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
  114. ---
  115. > typedef int32 (PNP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer);
  116. 653c653
  117. < typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
  118. ---
  119. > typedef NPError (PNP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
  120. 680c680
  121. < typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
  122. ---
  123. > typedef void (PNP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
  124. 706c706
  125. < typedef const char*     (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
  126. ---
  127. > typedef const char*     (PNP_LOADDS NPN_UserAgentUPP)(NPP instance);
  128. 732c732
  129. < typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
  130. ---
  131. > typedef void* (PNP_LOADDS NPN_MemAllocUPP)(uint32 size);
  132. 758c758
  133. < typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
  134. ---
  135. > typedef void (PNP_LOADDS NPN_MemFreeUPP)(void* ptr);
  136. 785c785
  137. < typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
  138. ---
  139. > typedef uint32 (PNP_LOADDS NPN_MemFlushUPP)(uint32 size);
  140. 813c813
  141. < typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
  142. ---
  143. > typedef void (PNP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
  144. 840c840
  145. < typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
  146. ---
  147. > typedef JRIEnv* (PNP_LOADDS NPN_GetJavaEnvUPP)(void);
  148. 867c867
  149. < typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
  150. ---
  151. > typedef jref (PNP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
  152. 977c977
  153. < #define OSCALL _System
  154. ---
  155. > #define OSCALL NP_LOADDS
  156. diff sample/npdraw/original/gendata.cpp sample/npdraw/gendata.cpp
  157. 25c25
  158. < main(int argc, char *argv[])
  159. ---
  160. > int main(int argc, char *argv[])
  161. 60a61
  162. >     return 0;
  163. diff sample/npdraw/original/npdraw.cpp sample/npdraw/npdraw.cpp
  164. 26a27,33
  165. > #if defined(__BORLANDC__)
  166. > #include <cstring.h>
  167. > #define IString string
  168. > #elif defined(__WATCOMC__)
  169. > #include <string.hpp>
  170. > #define IString String
  171. > #else
  172. 27a35,36
  173. > #endif
  174. 63a73,74
  175. > #if !defined(__BORLANDC__) && !defined(__WATCOMC__)
  176. 92c103
  177. < static void _System cleanup(ULONG ulReason);
  178. ---
  179. > static void NP_LOADDS cleanup(ULONG ulReason);
  180. 109c120
  181. < unsigned long _System _DLL_InitTerm(unsigned long hModule, unsigned long
  182. ---
  183. > unsigned long NP_LOADDS _DLL_InitTerm(unsigned long hModule, unsigned long
  184. 150c161
  185. < static void cleanup(ULONG ulReason)
  186. ---
  187. > static void NP_LOADDS cleanup(ULONG ulReason)
  188. 158a170,171
  189. > #endif // !defined(__BORLANDC__) && !defined(__WATCOMC__)
  190. 198c211
  191. < NPError NPP_Initialize(void)
  192. ---
  193. > NPError NP_LOADDS NPP_Initialize(void)
  194. 209c222
  195. < void NPP_Shutdown(void)
  196. ---
  197. > void NP_LOADDS NPP_Shutdown(void)
  198. 247c260
  199. <     This->hps = NULL;
  200. ---
  201. >     This->hps = NULLHANDLE;
  202. diff sample/npdraw/original/npdraw.def sample/npdraw/npdraw.def
  203. 10d9
  204. <         _DLL_InitTerm       @4
  205.