Changeset 326 for trunk/idl-compiler/c/nom-idl-compiler.c
- Timestamp:
- Apr 9, 2008, 10:22:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/idl-compiler/c/nom-idl-compiler.c
r310 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #define INCL_DOSPROCESS 35 #define INCL_DOS 36 #define INCL_DOSPROFILE 37 #define INCL_DOSERRORS 38 39 #include <os2.h> 34 #ifdef __OS2__ 35 # define INCL_DOSPROCESS 36 # define INCL_DOS 37 # define INCL_DOSPROFILE 38 # define INCL_DOSERRORS 39 # include <os2.h> 40 #endif /* __OS2__ */ 41 40 42 #include <stdio.h> 41 43 #include <stdlib.h> 42 44 #include <string.h> 43 45 44 #include <io.h> 46 #ifdef HAVE_IO_H 47 # include <io.h> 48 #endif 49 #ifdef HAVE_UNISTD_H 50 # include <unistd.h> 51 #endif 45 52 #include <fcntl.h> 46 #include <sys \stat.h>47 48 #include <glib.h> 53 #include <sys/stat.h> 54 55 #include <glib.h> 49 56 #include <glib/gprintf.h> 50 57 … … 60 67 61 68 /* Command line options */ 62 static GOptionEntry gOptionEntries[] = 69 static GOptionEntry gOptionEntries[] = 63 70 { 64 71 {"directory", 'd', 0, G_OPTION_ARG_FILENAME, &chrOutputDir, "Output directory", NULL}, … … 361 368 This is the root parse function. Here starts the fun. When a token is found in the 362 369 input stream which matches one of the known token types the respective parsing function 363 is called for further processing. In case of an error the parsing function in question 370 is called for further processing. In case of an error the parsing function in question 364 371 prints an error which describes the problem and exits the application. 365 372 … … 370 377 while(g_scanner_peek_next_token(gScanner) != G_TOKEN_EOF) { 371 378 GTokenType token; 379 GTokenValue value; 372 380 373 381 g_scanner_get_next_token(gScanner); 374 382 token=gScanner->token; 375 GTokenValuevalue=gScanner->value;376 383 value=gScanner->value; 384 377 385 switch(token) 378 386 { … … 468 476 filename\n\n"); 469 477 470 /* This prints the standard option help to screen. */ 478 /* This prints the standard option help to screen. */ 471 479 g_option_context_parse (gContext, &argc2, &argv2, &gError); 472 480 } … … 494 502 void funcMsgHandler(GScanner *gScanner, gchar *message, gboolean error) 495 503 { 496 g_printf("%s:%d: error: %s (%d %d)\n", parseInfo.chrCurrentSourceFile, 504 g_printf("%s:%d: error: %s (%d %d)\n", 505 parseInfo.chrCurrentSourceFile ? parseInfo.chrCurrentSourceFile : "<null>", /* glib doesn't check for NULL like printf. */ 497 506 g_scanner_cur_line(gScanner)-parseInfo.uiLineCorrection, message, 498 507 g_scanner_cur_line(gScanner), parseInfo.uiLineCorrection); … … 554 563 } 555 564 #endif 556 565 557 566 /*** Create output path name ****/ 558 567 if(g_path_is_absolute(chrOutputDir)) … … 572 581 else 573 582 fd=open(argv[1], O_RDONLY); 574 583 575 584 if(-1==fd) 576 585 { … … 600 609 while(pSymbols->chrSymbolName) 601 610 { 602 #warning !!! Create a copy here so it is the same as with new symbols added later. 611 #ifndef _MSC_VER 612 # warning !!! Create a copy here so it is the same as with new symbols added later. 613 #endif 603 614 g_scanner_scope_add_symbol(gScanner, ID_SCOPE, pSymbols->chrSymbolName, 604 615 pSymbols);
Note:
See TracChangeset
for help on using the changeset viewer.