Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.220
 
1.221
 
MAIN:ragge:20120802142439
 
cc.c
_>355355 
 356356 struct strlist preprocessor_flags;
 357357 struct strlist incdirs;
<> 358+struct strlist user_sysincdirs;
  359+struct strlist includes;
358360 
 359361 int
 360362 main(int argc, char *argv[])
 361363 {
 362364         struct string *s;
<>363 -        struct strlist *sl;
364365         struct Wflags *Wf;
 365366         char *t, *u, *argp;
 366367         char *assource;
<>367 -        char **pv, *ptemp[MAXOPT], **pvt;
368368         int nc, nl, nas, ncpp, i, j, c, nxo, na;
 369369 #ifdef MULTITARGET
 370370         int k;
     
 !
374374 
 375375         strlist_init(&preprocessor_flags);
 376376         strlist_init(&incdirs);
<> 377+        strlist_init(&user_sysincdirs);
  378+        strlist_init(&includes);
377379 
 378380         if ((t = strrchr(argv[0], '/')))
 379381                 t = copy(t+1, 0);
     
 !
422424 #endif
 423425 
 424426         nc = nl = nas = ncpp = nxo = 0;
<>425 -        pv = ptemp;
426427         while (--lac) {
 427428                 ++lav;
 428429                 argp = *lav;
     
 !
550551                                 kflag = F_pic;
 551552                         else if (strcmp(argp, "-ffreestanding") == 0)
 552553                                 freestanding = 1;
<>553 -                        else if (strcmp(argp,
 554 -                            "-fsigned-char") == 0)
  554+                        else if (match(argp, "-fsigned-char") ||
  555+                            match(argp, "-fno-unsigned-char"))
555556                                 xuchar = 0;
<>556 -                        else if (strcmp(argp,
 557 -                            "-fno-signed-char") == 0)
  557+                        else if (match(argp, "-fno-signed-char") ||
  558+                            match(argp, "-funsigned-char"))
558559                                 xuchar = 1;
<>559 -                        else if (strcmp(argp,
 560 -                            "-funsigned-char") == 0)
 561 -                                xuchar = 1;
 562 -                        else if (strcmp(argp,
 563 -                            "-fno-unsigned-char") == 0)
 564 -                                xuchar = 0;
 565 -                        else if (strcmp(argp,
 566 -                            "-fstack-protector") == 0) {
  560+                        else if (strcmp(argp, "-fstack-protector") == 0) {
567561                                 flist[nf++] = argp;
 568562                                 sspflag++;
<>569 -                        } else if (strcmp(argp,
 570 -                            "-fstack-protector-all") == 0) {
  563+                        } else if (strcmp(argp, "-fstack-protector-all") == 0) {
571564                                 flist[nf++] = argp;
 572565                                 sspflag++;
<>573 -                        } else if (strcmp(argp,
 574 -                            "-fno-stack-protector") == 0) {
  566+                        } else if (strcmp(argp, "-fno-stack-protector") == 0) {
575567                                 flist[nf++] = argp;
 576568                                 sspflag = 0;
<>577 -                        } else if (strcmp(argp,
 578 -                            "-fno-stack-protector-all") == 0) {
  569+                        } else if (strcmp(argp, "-fno-stack-protector-all") == 0) {
579570                                 flist[nf++] = argp;
 580571                                 sspflag = 0;
 581572                         }
     
 !
591582 
 592583                 case 'D':
 593584                 case 'U':
<>594 -                case 'I': /* Add include dirs */
 595 -                        sl = argp[1] == 'I' ? &incdirs : &preprocessor_flags;
 596 -                        strlist_append(sl, argp);
  585+                        strlist_append(&preprocessor_flags, argp);
597586                         if (argp[2] != 0)
 598587                                 break;
<>599 -                        strlist_append(sl, nxtopt(argp));
  588+                        strlist_append(&preprocessor_flags, nxtopt(argp));
600589                         break;
 601590 
<> 591+                case 'I': /* Add include dirs */
  592+                        strlist_append(&incdirs, nxtopt("-I"));
  593+                        break;
  594+
602595                 case 'i':
<>603 -                        if (strcmp(argp, "-isystem") == 0) {
 604 -                                *pv++ = "-S";
 605 -                                *pv++ = nxtopt("-isystem");
 606 -                        } else if (strcmp(argp, "-include") == 0) {
 607 -                                *pv++ = "-i";
 608 -                                *pv++ = nxtopt("-include");
  596+                        if (match(argp, "-isystem")) {
  597+                                strlist_append(&user_sysincdirs, nxtopt(0));
  598+                        } else if (match(argp, "-include")) {
  599+                                strlist_append(&includes, nxtopt(0));
609600                         } else if (strcmp(argp, "-idirafter") == 0) {
 610601                                 idirafter = nxtopt("-idirafter");
 611602 #ifdef os_darwin
     
 !
723714                         break;
 724715                 case 'P':
 725716                         pflag++;
<>726 -                        *pv++ = argp;
  717+                        strlist_append(&preprocessor_flags, argp);
  718+                        break;
  719+
727720                 case 'c':
 728721 #ifdef os_darwin
 729722                         if (strcmp(argp, "-compatibility_version") == 0) {
     
 !
857850 #ifdef MULTITARGET
 858851         pass0 = cat(LIBEXECDIR "/ccom_", mach);
 859852 #endif
<>860 -        pvt = pv;
861853         for (i=0; i<nc; i++) {
 862854                 /*
 863855                  * C preprocessor
     
 !
935927                 STRLIST_FOREACH(s, &preprocessor_flags) {
 936928                         av[na++] = s->value;
 937929                 }
<> 930+                STRLIST_FOREACH(s, &includes) {
  931+                        av[na++] = "-i";
  932+                        av[na++] = s->value;
  933+                }
938934                 STRLIST_FOREACH(s, &incdirs) {
<> 935+                        av[na++] = "-I";
939936                         av[na++] = s->value;
 940937                 }
<> 938+                STRLIST_FOREACH(s, &user_sysincdirs) {
  939+                        av[na++] = "-S";
  940+                        av[na++] = s->value;
  941+                }
941942                 av[na++] = "-D__STDC_ISO_10646__=200009L";
 942943                 av[na++] = "-D__WCHAR_TYPE__=" WCT;
 943944                 av[na++] = "-D__SIZEOF_WCHAR_T__=" MKS(WCHAR_SIZE);
     
 !
10021003 #endif
 10031004                 if (tflag)
 10041005                         av[na++] = "-t";
<>1005 -                for(pv=ptemp; pv <pvt; pv++)
 1006 -                        av[na++] = *pv;
10071006                 if (!nostdinc) {
 10081007                         av[na++] = "-S", av[na++] = cat(sysroot, altincdir);
 10091008                         av[na++] = "-S", av[na++] = cat(sysroot, incdir);
     
 !
13621361 #ifdef notdef
 13631362         strlist_free(&incdirs);
 13641363         strlist_free(&preprocessor_flags);
<> 1364+        strlist_free(&user_sysincdirs);
  1365+        strlist_free(&includes);
<_13651366 #endif
 13661367         dexit(eflag);
 13671368         return 0;
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-09-30 17:52 +0200