@@ -60,16 +60,14 @@ enum INC_ENV = "INCLUDE";
6060/*private*/ void predefine(const char *name);
6161/*private*/ void sw_d(char *);
6262/*private*/ void addpath(phstring_t *, const char *);
63- /*private*/ phstring_t mergepaths(phstring_t pathlist, phstring_t pathsyslist);
63+ /*private*/ void mergepaths(phstring_t pathlist, phstring_t pathsyslist, ref phstring_t result );
6464/*private*/ void getcmd_cflags(int *,char ***);
6565+/
6666
67- version (none )
68- {
6967__gshared
7068{
71- private __gshared char [2 ] one = " 1" ;
7269
70+ private __gshared char [2 ] one = " 1" ;
7371__gshared Config config = // part of configuration saved in ph
7472{
7573 ' D' , // compile for C++
@@ -84,20 +82,18 @@ __gshared Config config = // part of configuration saved in ph
8482Configv configv; // non-ph part of configuration
8583EEcontext eecontext;
8684
85+ char switch_E = 0 ; // for LINRECOR.ASM
8786extern (C )
8887{
89- char switch_E = 0 ; // for LINRECOR.ASM
9088int _version = VERSIONINT ;
9189}
9290
9391const (char )* versionString = " (SCVersion)@" ~ COMPILER ~ " " ~ VERSION ~ SUFFIX ;
9492const (char )* copyright = COPYRIGHT ;
9593}
9694
97- version (none )
98- {
95+ version (all ){
9996
100- }
10197version (_WINDLL)
10298{
10399}
@@ -234,23 +230,22 @@ version(all){
234230 dotext = filespecdotext(p);
235231version (SPP)
236232{
237- if (filespeccmp(dotext,ext_i) == 0 )
233+ if (filespeccmp(dotext,ext_i.ptr ) == 0 )
238234 foutname = p;
239- else if (filespeccmp(dotext,ext_dep) == 0 )
235+ else if (filespeccmp(dotext,ext_dep.ptr ) == 0 )
240236 fdepname = p;
241237 else
242238 finname = p;
243239}
244240else version (HTOD)
245241{
246- if (filespeccmp(dotext,ext_dmodule) == 0 )
242+ if (filespeccmp(dotext,ext_dmodule.ptr ) == 0 )
247243 fdmodulename = p;
248244 else
249245 finname = p;
250246}
251247else
252248{
253-
254249 if (filespeccmp(dotext,ext_obj.ptr) == 0 )
255250 foutname = p;
256251 else if (filespeccmp(dotext,ext_dep.ptr) == 0 )
@@ -630,6 +625,11 @@ version (HTOD)
630625 default : /* ignore invalid flags */
631626 config.flags2 &= ~ (CFG2phgen | CFG2phuse | CFG2phauto | CFG2phautoy | CFG2once);
632627 break ;
628+ }
629+ else
630+ {
631+ default :
632+ break ;
633633 }
634634 }
635635 break ;
@@ -1417,8 +1417,11 @@ else
14171417 addpath(&pathsyslist, p + 7 );
14181418 break ;
14191419 case ' X' :
1420+ version (SCPP)
1421+ {
14201422 if (CPP && template_getcmd(p))
14211423 goto badflag;
1424+ }
14221425 break ;
14231426 default :
14241427 break ;
@@ -1434,7 +1437,7 @@ else
14341437 */
14351438 addpath(&pathlist, getenv (INC_ENV )); // get path from environment
14361439 }
1437- pathlist = mergepaths(pathlist, pathsyslist);
1440+ mergepaths(pathlist, pathsyslist, pathlist );
14381441
14391442 if (! switch_U) /* if didn't turn them off */
14401443 {
@@ -1688,6 +1691,7 @@ else
16881691
16891692 linkage = config.linkage;
16901693}
1694+ }
16911695
16921696
16931697/* ****************************
@@ -1696,6 +1700,7 @@ else
16961700
16971701/* private*/ void predefine(const (char )* name)
16981702{
1703+ __gshared char [2 ] one = " 1" ;
16991704 if (* name == ' _' || ! config.ansi_c)
17001705 defmac(name,one.ptr);
17011706}
@@ -1711,6 +1716,8 @@ else
17111716/* private*/ void sw_d(char * p)
17121717{ char * pstart;
17131718
1719+ __gshared char [2 ] one = " 1" ;
1720+
17141721 if (! * p)
17151722 { defmac(" DEBUG" ,one.ptr);
17161723 config.flags5 |= CFG5debug | CFG5in | CFG5out | CFG5invariant;
@@ -1813,15 +1820,17 @@ static if (0)
18131820 * pathsysi
18141821 */
18151822
1816- /* private*/ phstring_t mergepaths(phstring_t pathlist, phstring_t pathsyslist)
1823+ /* private*/ void mergepaths(phstring_t pathlist, phstring_t pathsyslist, ref phstring_t res )
18171824{
18181825 if (pathsyslist.length() == 0 )
18191826 {
18201827 pathsysi = pathlist.length();
1821- return pathlist;
1828+ res = pathlist;
1829+ return ;
18221830 }
18231831
1824- phstring_t result;
1832+ phstring_t result = void ;
1833+ result.dim = 0 ;
18251834
18261835 for (size_t i = 0 ; i < pathlist.length(); ++ i)
18271836 {
@@ -1840,8 +1849,7 @@ static if (0)
18401849 pathlist.free(&mem_freefp);
18411850 pathsyslist.free(&mem_freefp);
18421851
1843- return result;
1844- }
1852+ res = result;
18451853}
18461854
18471855/* ********************************
0 commit comments