Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.218
 
1.219
 
MAIN:ragge:20120802111552
 
cc.c
_>150150 char *gettmp(void);
 151151 void *ccmalloc(int size);
 152152 void aerror(char *);
<> 153+void oerror(char *);
153154 char *argnxt(char *, char *);
 154155 #ifdef os_win32
 155156 char *win32pathsubst(char *);
     
 !
350351 #endif
 351352 
 352353 struct strlist preprocessor_flags;
<> 354+struct strlist incdirs;
353355 
 354356 int
 355357 main(int argc, char *argv[])
 356358 {
 357359         struct string *s;
<> 360+        struct strlist *sl;
358361         struct Wflags *Wf;
 359362         char *t, *u, *argp;
 360363         char *assource;
     
 !
365368 #endif
 366369 
 367370         strlist_init(&preprocessor_flags);
<> 371+        strlist_init(&incdirs);
368372 
 369373         if ((t = strrchr(argv[0], '/')))
 370374                 t = copy(t+1, 0);
     
 !
473477                                 if (match(argp, "-C") || match(argp, "-CC"))
 474478                                         strlist_append(&preprocessor_flags, argp);
 475479                                 else
<>476 -                                        aerror(argp);
  480+                                        oerror(argp);
477481                                 break;
 478482 
 479483                         case 'X':
     
 !
578582                                         gflag++;
 579583                                 break;
 580584 
<> 585+                        case 'D':
  586+                        case 'U':
  587+                        case 'I': /* Add include dirs */
  588+                                sl = argp[1] == 'I' ? &incdirs : &preprocessor_flags;
  589+                                strlist_append(sl, argp);
  590+                                if (argp[2] != 0)
  591+                                        break;
  592+                                if (argc == i+1)
  593+                                        aerror(argp);
  594+                                strlist_append(sl, argv[++i]);
  595+                                break;
  596+
581597                         case 'i':
 582598                                 if (strcmp(argv[i], "-isystem") == 0) {
 583599                                         *pv++ = "-S";
     
 !
723739                                 }
 724740                                 break;
 725741 #endif
<>726 -                        case 'D':
 727 -                        case 'I':
 728 -                        case 'U':
 729 -                                *pv++ = argv[i];
 730 -                                if (argv[i][2] == '\0')
 731 -                                        *pv++ = argv[++i];
 732 -                                if (pv >= ptemp+MAXOPT) {
 733 -                                        error("Too many DIU options");
 734 -                                        --pv;
 735 -                                }
 736 -                                break;
 737 -
738742                         case 'M':
 739743                                 switch (argv[i][2]) {
 740744                                 case '\0': Mflag++; break;
     
 !
925929                 STRLIST_FOREACH(s, &preprocessor_flags) {
 926930                         av[na++] = s->value;
 927931                 }
<> 932+                STRLIST_FOREACH(s, &incdirs) {
  933+                        av[na++] = s->value;
  934+                }
928935                 av[na++] = "-D__STDC_ISO_10646__=200009L";
 929936                 av[na++] = "-D__WCHAR_TYPE__=" WCT;
 930937                 av[na++] = "-D__SIZEOF_WCHAR_T__=" MKS(WCHAR_SIZE);
     
 !
13461353                                 cunlink(olist[i]);
 13471354                 }
 13481355         }
<> 1356+#ifdef notdef
  1357+        strlist_free(&incdirs);
  1358+        strlist_free(&preprocessor_flags);
  1359+#endif
13491360         dexit(eflag);
 13501361         return 0;
 13511362 }
     
 !
16811692 }
 16821693 
 16831694 void
<>1684 -aerror(char *s)
  1695+oerror(char *s)
16851696 {
 16861697         fprintf(stderr, "error: unknown option '%s'\n", s);
 16871698         exit(1);
 16881699 }
 16891700 
<> 1701+void
  1702+aerror(char *s)
  1703+{
  1704+        fprintf(stderr, "error: missing argument to '%s'\n", s);
  1705+        exit(1);
  1706+}
  1707+
<_16901708 /*
 16911709  * See if m matches the beginning of string str, if it does return the
 16921710  * remaining of str, otherwise NULL.
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-31 15:17 +0100