Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.227
 
1.228
 
MAIN:ragge:20120805174301
 
cc.c
_>14441444 };
 14451445 
 14461446 static void
<>1447 -cksetflags(struct flgcheck *fs, struct strlist *sl)
  1447+cksetflags(struct flgcheck *fs, struct strlist *sl, int which)
14481448 {
<> 1449+        void (*fn)(struct strlist *, const char *);
14491450 
<> 1451+        fn = which == 'p' ? strlist_prepend : strlist_append;
14501452         for (; fs->flag; fs++) {
 14511453                 if (fs->set && *fs->flag)
<>1452 -                        strlist_append(sl, fs->def);
  1454+                        fn(sl, fs->def);
14531455                 if (!fs->set && !*fs->flag)
<>1454 -                        strlist_append(sl, fs->def);
  1456+                        fn(sl, fs->def);
14551457         }
 14561458 }
 14571459 
     
 !
15451547 
 15461548         /* a bunch of misc defines */
 15471549         for (i = 0; i < (int)sizeof(defflags)/(int)sizeof(char *); i++)
<>1548 -                strlist_append(&preprocessor_flags, defflags[i]);
  1550+                strlist_prepend(&preprocessor_flags, defflags[i]);
15491551 
 15501552         for (i = 0; i < (int)sizeof(gcppflags)/(int)sizeof(char *); i++)
<>1551 -                strlist_append(&preprocessor_flags, gcppflags[i]);
 1552 -        strlist_append(&preprocessor_flags, xgnu89 ?
  1553+                strlist_prepend(&preprocessor_flags, gcppflags[i]);
  1554+        strlist_prepend(&preprocessor_flags, xgnu89 ?
15531555             "-D__GNUC_GNU_INLINE__" : "-D__GNUC_STDC_INLINE__");
 15541556 
<>1555 -        cksetflags(cppflgcheck, &preprocessor_flags);
  1557+        cksetflags(cppflgcheck, &preprocessor_flags, 'p');
15561558 
 15571559         for (i = 0; i < (int)sizeof(fpflags)/(int)sizeof(char *); i++)
<>1558 -                strlist_append(&preprocessor_flags, fpflags[i]);
  1560+                strlist_prepend(&preprocessor_flags, fpflags[i]);
15591561 
 15601562         for (i = 0; cppadd[i]; i++)
<>1561 -                strlist_append(&preprocessor_flags, cppadd[i]);
  1563+                strlist_prepend(&preprocessor_flags, cppadd[i]);
15621564         for (i = 0; cppmdadd[i]; i++)
<>1563 -                strlist_append(&preprocessor_flags, cppmdadd[i]);
  1565+                strlist_prepend(&preprocessor_flags, cppmdadd[i]);
15641566 
 15651567         /* Include dirs */
 15661568         strlist_append(&sysincdirs, "=" INCLUDEDIR "pcc/");
     
 !
15851587         { &xgnu99, 1, "-xgnu99" },
 15861588         { &xuchar, 1, "-xuchar" },
 15871589 #if !defined(os_sunos) && !defined(mach_i386)
<>1588 -        { &vflag, 0, "-v" },
  1590+        { &vflag, 1, "-v" },
15891591 #endif
 15901592 #ifdef os_darwin
 15911593         { &Bstatic, 1, "-k" },
     
 !
16041606 {
 16051607         struct Wflags *Wf;
 16061608 
<>1607 -        cksetflags(ccomflgcheck, &compiler_flags);
  1609+        cksetflags(ccomflgcheck, &compiler_flags, 'a');
16081610         if (Wflag || Wallflag) {
 16091611                 /* -Wall is same as gcc, -WW is all flags */
 16101612                 for (Wf = Wflags; Wf->name; Wf++) {
     
 !
16601662 setup_as_flags(void)
 16611663 {
 16621664         one = one;
<>1663 -        cksetflags(asflgcheck, &assembler_flags);
  1665+        cksetflags(asflgcheck, &assembler_flags, 'a');
16641666 }
 16651667 
 16661668 struct flgcheck ldflgcheck[] = {
     
 !
16971699         { 0 },
 16981700 };
 16991701 
<> 1702+static void
  1703+strap(struct strlist *sh, struct strlist *cd, char *n, int where)
  1704+{
  1705+        void (*fn)(struct strlist *, const char *);
  1706+        char *fil;
  1707+
  1708+        if (n == 0)
  1709+                return; /* no crtfile */
  1710+
  1711+        fn = where == 'p' ? strlist_prepend : strlist_append;
  1712+        fil = find_file(n, cd, R_OK);
  1713+        (*fn)(sh, fil);
  1714+}
  1715+
17001716 void
 17011717 setup_ld_flags(void)
 17021718 {
<> 1719+        char *b, *e;
17031720         int i;
 17041721 
<>1705 -        cksetflags(ldflgcheck, &early_linker_flags);
  1722+        cksetflags(ldflgcheck, &early_linker_flags, 'a');
17061723         if (Bstatic == 0)
 17071724                 for (i = 0; dynlinker[i]; i++)
 17081725                         strlist_append(&early_linker_flags, dynlinker[i]);
     
 !
17321749         }
 17331750         if (!nostartfiles) {
 17341751                 if (shared) {
<>1735 -                        strlist_prepend(&middle_linker_flags,
 1736 -                            find_file(CRTBEGIN_S, &crtdirs, R_OK));
 1737 -                        strlist_append(&late_linker_flags,
 1738 -                            find_file(CRTEND_S, &crtdirs, R_OK));
  1752+                        strap(&middle_linker_flags, &crtdirs, CRTBEGIN_S, 'p');
  1753+                        strap(&late_linker_flags, &crtdirs, CRTEND_S, 'a');
17391754                 } else {
 17401755                         if (Bstatic) {
<>1741 -                                strlist_prepend(&middle_linker_flags,
 1742 -                                    find_file(CRTBEGIN_T, &crtdirs, R_OK));
 1743 -                                strlist_append(&late_linker_flags,
 1744 -                                    find_file(CRTEND_T, &crtdirs, R_OK));
  1756+                                b = CRTBEGIN_T;
  1757+                                e = CRTEND_T;
17451758 #ifdef notyet
 17461759                         } else if (pieflag) {
<>1747 -                                strlist_prepend(&middle_linker_flags,
 1748 -                                    find_file(CRTBEGIN_S, &crtdirs, R_OK));
 1749 -                                strlist_append(&late_linker_flags,
 1750 -                                    find_file(CRTEND_S, &crtdirs, R_OK));
  1760+                                b = CRTBEGIN_S;
  1761+                                e = CRTEND_S;
17511762 #endif
<>1752 -                        } else {
 1753 -                                strlist_prepend(&middle_linker_flags,
 1754 -                                    find_file(CRTBEGIN, &crtdirs, R_OK));
 1755 -                                strlist_append(&late_linker_flags,
 1756 -                                    find_file(CRTEND, &crtdirs, R_OK));
  1763+                        }  else {
  1764+                                b = CRTBEGIN;
  1765+                                e = CRTEND;
17571766                         }
<>1758 -                        strlist_prepend(&middle_linker_flags,
 1759 -                            find_file(CRTI, &crtdirs, R_OK));
 1760 -                        strlist_append(&late_linker_flags,
 1761 -                            find_file(CRTN, &crtdirs, R_OK));
  1767+                        strap(&middle_linker_flags, &crtdirs, b, 'p');
  1768+                        strap(&late_linker_flags, &crtdirs, e, 'a');
  1769+                        strap(&middle_linker_flags, &crtdirs, CRTI, 'p');
  1770+                        strap(&late_linker_flags, &crtdirs, CRTN, 'a');
17621771                         if (pgflag)
<>1763 -                                strlist_prepend(&middle_linker_flags,
 1764 -                                    find_file(GCRT0, &crtdirs, R_OK));
  1772+                                b = GCRT0;
17651773 #ifdef notyet
 17661774                         else if (pieflag)
<>1767 -                                strlist_prepend(&middle_linker_flags,
 1768 -                                    find_file(SCRT0, &crtdirs, R_OK));
  1775+                                b = SCRT0;
17691776 #endif
 17701777                         else
<>1771 -                                strlist_prepend(&middle_linker_flags,
 1772 -                                    find_file(CRT0, &crtdirs, R_OK));
  1778+                                b = CRT0;
  1779+                        strap(&middle_linker_flags, &crtdirs, b, 'p');
<_17731780                 }
 17741781         }
 17751782 }
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-01 13:19 +0200