Changeset 326 for trunk/idl-compiler/ih-emitter_c
- Timestamp:
- Apr 9, 2008, 10:22:08 PM (17 years ago)
- Location:
- trunk/idl-compiler/ih-emitter_c
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/idl-compiler/ih-emitter_c/ih_file_emitter.c
r293 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdlib.h> 36 39 #include <string.h> … … 80 83 fprintf(fh, " %s;\n", piv->chrName); 81 84 } 82 fprintf(fh, "}%sData;\n\n", pif->chrName); 85 #ifdef _MSC_VER 86 if(!a) 87 fprintf(fh, " int iDummy;\n"); /* HACK ALERT! */ 88 #endif 89 fprintf(fh, "} %sData;\n\n", pif->chrName); 83 90 } 84 91 … … 86 93 { 87 94 FILE* fh=pLocalPI->outFile; 88 GPtrArray *pArray=pif->pInstanceVarArray; ;95 GPtrArray *pArray=pif->pInstanceVarArray; 89 96 int a; 90 97 … … 116 123 117 124 fprintf(fh, "/*** Class data structures ***/\n"); 118 fprintf(fh, " struct %sClassDataStructure %sClassData = {0};\n", pif->chrName, pif->chrName );119 fprintf(fh, " staticstruct %sCClassDataStructure %sCClassData = {0};\n\n",125 fprintf(fh, "NOMDLLEXPORT struct %sClassDataStructure %sClassData = {0};\n", pif->chrName, pif->chrName ); 126 fprintf(fh, "NOMDLLEXPORT struct %sCClassDataStructure %sCClassData = {0};\n\n", 120 127 pif->chrName, pif->chrName); 121 128 } … … 126 133 NOMEXTERN gboolean NOMLINK objectCheckFunc_WPRootFolder(WPRootFolder *nomSelf, gchar* chrMethodName) 127 134 { 128 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf , WPRootFolderClassData.classObject, NULL HANDLE))135 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf , WPRootFolderClassData.classObject, NULL)) 129 136 { 130 137 nomPrintObjectPointerError(nomSelf, "WPRootFolder", chrMethodName); … … 170 177 fprintf(fh, "\",\n"); 171 178 } 179 #ifdef _MSC_VER 180 if(!a) 181 fprintf(fh, " NULL\n"); 182 #endif 172 183 } 173 184 … … 187 198 fprintf(fh, "#if !defined(_decl_impl_%s_%s_)\n", pif->chrName, pm->chrName); 188 199 fprintf(fh, "#define _decl_impl_%s_%s_ 1\n", pif->chrName, pm->chrName); 189 fprintf(fh, "NOM _Scope ");200 fprintf(fh, "NOMDLLEXPORT NOM_Scope "); 190 201 emitReturnType(pLocalPI, pif, pm); 191 202 fprintf(fh, " NOMLINK impl_%s_%s(%s *nomSelf,\n", pif->chrName, pm->chrName, pif->chrName); … … 238 249 } 239 250 240 fprintf(fh, "NOM _Scope ");251 fprintf(fh, "NOMDLLEXPORT NOM_Scope "); 241 252 emitReturnType(pLocalPI, pif, pm); 242 253 fprintf(fh, " NOMLINK impl_%s_%s(%s* nomSelf,\n", pif->chrName, pom->chrName, pif->chrName); … … 271 282 fprintf(fh, "static nomOverridenMethodDesc nomOverridenMethods%s[] = {\n", pif->chrName); 272 283 284 pArray=pif->pOverrideArray; 285 273 286 for(a=0;a<pArray->len;a++) 274 287 { … … 289 302 fprintf(fh, " },\n"); 290 303 } 291 fprintf(fh, "};\n\n"); 304 #ifdef _MSC_VER 305 if(!a) 306 fprintf(fh, " { NULL, NULL, NULL }\n"); 307 #endif 308 fprintf(fh, "};\n\n"); 292 309 } 293 310 … … 316 333 fprintf(fh, "},\n"); 317 334 } 335 #ifdef _MSC_VER 336 if(!a) 337 fprintf(fh, " { NULL, NULL, NULL, NULL, NULL }\n"); 338 #endif 318 339 fprintf(fh, "};\n\n"); 319 340 } … … 344 365 /* Emit the parents. We have to output them sorted beginning from the 345 366 leftmost parent. */ 346 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL HANDLE)367 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL) 347 368 { 348 369 g_ptr_array_add(pArray, (gpointer) pifParent); … … 372 393 PINTERFACE pifParent=pif; 373 394 374 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL HANDLE)395 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL) 375 396 ulRet++; 376 397 … … 498 519 } 499 520 fprintf(fh, "#include \"nomgc.h\"\n"); 521 fprintf(fh, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n", pif->chrName); 522 fprintf(fh, "NOMDLLEXPORT\n"); 523 fprintf(fh, "#else\n"); 524 fprintf(fh, "NOMDLLIMPORT\n"); 525 fprintf(fh, "#endif\n"); 500 526 fprintf(fh, "NOMClass* NOMLINK %sNewClass(gulong ulMajor, gulong ulMinor)\n", pif->chrName); 501 527 fprintf(fh, "{\n"); … … 516 542 fprintf(fh, " nomEndRegisterDLLWithGC(hReg);\n"); 517 543 fprintf(fh, " }\n"); 544 fprintf(fh, "#elif defined(_WIN32)\n"); 545 fprintf(fh, " /* FIXME: check this up with the GC. */\n"); 546 fprintf(fh, "#elif defined(__APPLE__)\n"); 547 fprintf(fh, "# warning FIXME: Check out GC/dylib.\n"); 548 fprintf(fh, "#elif defined(__linux__)\n"); 549 fprintf(fh, "# warning FIXME: Check out GC/so on linux.\n"); 518 550 fprintf(fh, "#else\n"); 519 551 fprintf(fh, "#error DLL must be registered with the garbage collector!\n"); … … 562 594 //printInterface(pif); 563 595 chrTemp=g_strconcat(pif->chrFileStem, ".ih", NULL); 564 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL HANDLE)596 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL) 565 597 { 566 598 emitIHFileHeader(pLocalPI, pif);
Note:
See TracChangeset
for help on using the changeset viewer.