Skip to content

Commit 97ecd69

Browse files
committed
* fixed calling linker to build with VC runtime of VS2015: legacy_stdio_definitions.lib missing
* bugzilla 12021: C++ projects (and others probably, too) might not load correctly in a solution that also contains a Visual D project * VS2015 linker updates logs and telemetry data files, confusing tracked linker dependencies. Now ignoring files that are both read and written. * remove some COM leaks
1 parent bd79257 commit 97ecd69

File tree

10 files changed

+89
-46
lines changed

10 files changed

+89
-46
lines changed

CHANGES

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,15 +765,15 @@ unreleased Version 0.3.43
765765
* replaced ancient pkgcmd.ctc with pkgcmd.vsct that's buildable with newer VS SDKs
766766
* added icons to some commands
767767
* renamed command "Add Folder" in project folder context menu to "Add Filter"
768-
* added command "Add Package" to project folder context menu
768+
* added command "Add Folder" to project folder context menu that actually creates the folder on disk
769769
* renaming a module in the project tree now reopens it at the previous caret location
770770
* renaming a package in the project tree also renames the folder on disk if it is still empty
771771
* debug info: added option "suitable for selected debug engine"
772772
* the original semantic analysis engine is no longer installed, always using dparser now
773773
* LDC: recent versions build object files into intermediate folder, wrong names passed to linker
774774
with "separate compile and link"
775775
* moved defaults for resource includes and dmd executable paths from installation to extension init
776-
* fixed spurious "not implemented" error in error list
776+
* fixed spurious "not implemented" error in error list of VS 2015
777777
* fix dark theme detection in VS 2015
778778
* better semantic/colorizer support for versions LDC,CRuntime_Microsoft,CRuntime_DigitalMars and MinGW
779779
* tweaked default path and library settings for DMD and LDC
@@ -783,3 +783,8 @@ unreleased Version 0.3.43
783783
- scale some controls vertically if there is space
784784
- added browse buttons to path settings
785785
* search pane did not save its last state, only when switching between file and symbol search
786+
* fixed calling linker to build with VC runtime of VS2015: legacy_stdio_definitions.lib missing
787+
* bugzilla 12021: C++ projects (and others probably, too) might not load correctly in a solution
788+
that also contains a Visual D project
789+
* VS2015 linker updates logs and telemetry data files, confusing tracked linker dependencies.
790+
Now ignoring files that are both read and written.

TODO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Project:
4040
- custom command: quotes in dependencies not supported
4141
- custom command: writes build batch to project folder
4242
- custom command: no output given => creates ".build.cmd"
43-
- single file commands: track dependencies
43+
- single file commands: track dependencies, also outputs
4444
- single file commands: multiple outputs
4545

4646
- VS2013: property pages don't follow resize

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 3
33
#define VERSION_REVISION 43
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 1
5+
#define VERSION_BUILD 2

stdext/stdext.visualdproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<vtls>0</vtls>
118118
<vgc>0</vgc>
119119
<symdebug>0</symdebug>
120-
<optimize>0</optimize>
120+
<optimize>1</optimize>
121121
<cpu>0</cpu>
122122
<isX86_64>0</isX86_64>
123123
<isLinux>0</isLinux>
@@ -136,7 +136,7 @@
136136
<noboundscheck>0</noboundscheck>
137137
<useSwitchError>0</useSwitchError>
138138
<useUnitTests>0</useUnitTests>
139-
<useInline>0</useInline>
139+
<useInline>1</useInline>
140140
<release>1</release>
141141
<preservePaths>0</preservePaths>
142142
<warnings>0</warnings>

tools/pipedmd.d

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ int main(string[] argv)
9898
string command;
9999
string trackdir;
100100
string trackfile;
101+
string trackfilewr;
101102

102103
bool inject = false;
103104
if (depsfile.length > 0)
@@ -118,7 +119,7 @@ int main(string[] argv)
118119
if (trackdir != ".")
119120
command ~= " /if " ~ quoteArg(trackdir);
120121
trackfile = stripExtension(baseName(exe)) ~ ".read.*.tlog";
121-
string trackfilewr = stripExtension(baseName(exe)) ~ ".write.*.tlog";
122+
trackfilewr = stripExtension(baseName(exe)) ~ ".write.*.tlog";
122123
foreach(f; std.file.dirEntries(trackdir, std.file.SpanMode.shallow))
123124
if (globMatch(baseName(f), trackfile) || globMatch(baseName(f), trackfilewr))
124125
std.file.remove(f.name);
@@ -146,16 +147,38 @@ int main(string[] argv)
146147

147148
if (exitCode == 0 && trackfile.length > 0)
148149
{
149-
ubyte[] buf;
150+
// read read.*.tlog and remove all files found in write.*.log
151+
string rdbuf;
152+
string wrbuf;
150153
foreach(f; std.file.dirEntries(trackdir, std.file.SpanMode.shallow))
151-
if (globMatch(baseName(f), trackfile))
154+
{
155+
bool rd = globMatch(baseName(f), trackfile);
156+
bool wr = globMatch(baseName(f), trackfilewr);
157+
if (rd || wr)
152158
{
153159
ubyte[] fbuf = cast(ubyte[])std.file.read(f.name);
160+
string cbuf;
154161
// strip BOM from all but the first file
155-
if (buf.length && fbuf.length > 1 && fbuf[0] == 0xFF && fbuf[1] == 0xFE)
156-
fbuf = fbuf[2..$];
157-
buf ~= fbuf;
162+
if(fbuf.length > 1 && fbuf[0] == 0xFF && fbuf[1] == 0xFE)
163+
cbuf = to!(string)(cast(wstring)(fbuf[2..$]));
164+
else
165+
cbuf = cast(string)fbuf;
166+
if(rd)
167+
rdbuf ~= cbuf;
168+
else
169+
wrbuf ~= cbuf;
158170
}
171+
}
172+
string[] rdlines = splitLines(rdbuf, KeepTerminator.yes);
173+
string[] wrlines = splitLines(wrbuf, KeepTerminator.yes);
174+
bool[string] wrset;
175+
foreach(w; wrlines)
176+
wrset[w] = true;
177+
178+
string buf;
179+
foreach(r; rdlines)
180+
if(r !in wrset)
181+
buf ~= r;
159182

160183
std.file.write(depsfile, buf);
161184
}

visuald/automation.d

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,24 @@ class ExtProjectItems : DisposingDispatchObject, dte.ProjectItems
577577
return returnError(E_NOTIMPL);
578578
}
579579

580+
override int Invoke(/* [in] */ in DISPID dispIdMember,
581+
/* [in] */ in IID* riid,
582+
/* [in] */ in LCID lcid,
583+
/* [in] */ in WORD wFlags,
584+
/* [out][in] */ DISPPARAMS *pDispParams,
585+
/* [out] */ VARIANT *pVarResult,
586+
/* [out] */ EXCEPINFO *pExcepInfo,
587+
/* [out] */ UINT *puArgErr)
588+
{
589+
mixin(LogCallMix);
590+
if (dispIdMember == -4)
591+
{
592+
pVarResult.vt = VT_UNKNOWN;
593+
return _NewEnum(&pVarResult.punkVal);
594+
}
595+
return super.Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
596+
}
597+
580598
ExtProject mExtProject;
581599
ExtProjectItems mParent;
582600
CHierNode mNode;
@@ -601,12 +619,11 @@ class ExtProperties : DisposingDispatchObject, dte.Properties
601619
{
602620
this(ExtProject prj)
603621
{
604-
mProject = addref(prj);
622+
mProject = prj;
605623
}
606624

607625
override void Dispose()
608626
{
609-
mProject = release(mProject);
610627
}
611628

612629
override HRESULT QueryInterface(in IID* riid, void** pvObject)
@@ -709,14 +726,13 @@ class ExtProperty(T) : DisposingDispatchObject, dte.Property
709726
{
710727
this(ExtProperties props, string name, T value)
711728
{
712-
mProperties = addref(props);
729+
mProperties = props;
713730
mName = name;
714731
mValue = value;
715732
}
716733

717734
override void Dispose()
718735
{
719-
mProperties = release(mProperties);
720736
}
721737

722738
override HRESULT QueryInterface(in IID* riid, void** pvObject)
@@ -884,12 +900,7 @@ class ExtProject : ExtProjectItem, dte.Project
884900
{
885901
super(this, null, prj.GetProjectNode());
886902
mProject = prj;
887-
mProperties = addref(newCom!ExtProperties(this));
888-
}
889-
890-
override void Dispose()
891-
{
892-
mProperties = release(mProperties);
903+
mProperties = newCom!ExtProperties(this);
893904
}
894905

895906
override HRESULT QueryInterface(in IID* riid, void** pvObject)
@@ -1168,12 +1179,12 @@ class ExtProject : ExtProjectItem, dte.Project
11681179
/* [retval][out] */ dte.ProjectItem *ppParentProjectItem)
11691180
{
11701181
mixin(LogCallMix);
1182+
*ppParentProjectItem = null;
11711183

11721184
IVsSolution srpSolution = queryService!(IVsSolution);
11731185
if(!srpSolution)
11741186
return returnError(E_FAIL);
11751187

1176-
*ppParentProjectItem = null;
11771188
int hr = E_UNEXPECTED;
11781189

11791190
IVsHierarchy pIVsHierarchy = mProject; // ->GetIVsHierarchy();

visuald/chiernode.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CHierNode : DisposingDispatchObject
8383

8484
override void Dispose()
8585
{
86-
m_extNode = release(m_extNode);
86+
//m_extNode = release(m_extNode);
8787
}
8888

8989
static void setContainerIsSorted(bool sort)
@@ -247,7 +247,7 @@ public:
247247
{
248248
pvar.vt = VT_DISPATCH;
249249
if(!m_extNode)
250-
m_extNode = addref(newCom!ExtProjectItem(null, null, this));
250+
m_extNode = /*addref*/(newCom!ExtProjectItem(null, null, this));
251251
pvar.pdispVal = addref(m_extNode);
252252
return S_OK;
253253
}

visuald/config.d

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,10 @@ class ProjectOptions
918918
string[] libs = tokenizeArgs(libfiles);
919919
libs ~= "user32.lib";
920920
libs ~= "kernel32.lib";
921+
if(useMSVCRT())
922+
if(std.file.exists(Package.GetGlobalOptions().VCInstallDir ~ "lib\\legacy_stdio_definitions.lib"))
923+
libs ~= "legacy_stdio_definitions.lib";
924+
921925
cmd ~= plusList(lnkfiles ~ libs, ".lib", plus);
922926
string[] lpaths = tokenizeArgs(libpaths);
923927
if(useStdLibPath)

visuald/dproject.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class Project : CVsHierarchy,
243243
override void Dispose()
244244
{
245245
mConfigProvider = release(mConfigProvider);
246-
mExtProject = release(mExtProject);
246+
//mExtProject = release(mExtProject);
247247
super.Dispose();
248248
}
249249

@@ -700,7 +700,7 @@ class Project : CVsHierarchy,
700700
case VSHPROPID_ExtObject:
701701
var.vt = VT_DISPATCH;
702702
if(!mExtProject)
703-
mExtProject = addref(newCom!ExtProject(this));
703+
mExtProject = /*addref*/(newCom!ExtProject(this));
704704
var.pdispVal = addref(mExtProject);
705705
return S_OK;
706706

visuald/visuald.visualdproj

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
<useArrayBounds>0</useArrayBounds>
3434
<noboundscheck>0</noboundscheck>
3535
<useSwitchError>0</useSwitchError>
36-
<useUnitTests>1</useUnitTests>
36+
<useUnitTests>0</useUnitTests>
3737
<useInline>0</useInline>
3838
<release>0</release>
3939
<preservePaths>0</preservePaths>
4040
<warnings>0</warnings>
4141
<infowarnings>1</infowarnings>
4242
<checkProperty>0</checkProperty>
43-
<genStackFrame>1</genStackFrame>
43+
<genStackFrame>0</genStackFrame>
4444
<pic>0</pic>
4545
<cov>0</cov>
4646
<nofloat>0</nofloat>
@@ -515,11 +515,11 @@
515515
<File path="workaround.d" />
516516
</Folder>
517517
<Folder name="gc">
518-
<File path="..\..\..\rainers\druntime\src\gc\gcdump.d" tool="None" />
519-
<File path="..\..\..\rainers\druntime\src\gc\gcx.d" tool="None" />
520-
<File path="..\..\..\rainers\druntime\src\rt\lifetime.d" tool="None" />
521-
<File path="..\..\..\rainers\druntime\src\rt\sections_win32.d" tool="None" />
522-
<File path="..\vdc\semantic.d" tool="None" />
518+
<File tool="None" path="..\..\..\rainers\druntime\src\gc\gcdump.d" />
519+
<File tool="None" path="..\..\..\rainers\druntime\src\gc\gcx.d" />
520+
<File tool="None" path="..\..\..\rainers\druntime\src\rt\lifetime.d" />
521+
<File tool="None" path="..\..\..\rainers\druntime\src\rt\sections_win32.d" />
522+
<File tool="None" path="..\vdc\semantic.d" />
523523
</Folder>
524524
<Folder name="language">
525525
<File path="colorizer.d" />
@@ -552,7 +552,7 @@
552552
<File path="Resources\DSplashScreenIcon.bmp" />
553553
<File path="Resources\faninout.ico" />
554554
<File path="Resources\GroupByType.ico" />
555-
<File path="Resources\pkgcmd.vsct" customcmd="set VSSDKInstall=%VSSDK140Install%
555+
<File tool="Custom" path="Resources\pkgcmd.vsct" customcmd="set VSSDKInstall=%VSSDK140Install%
556556
if &quot;%VSSDKInstall%&quot; == &quot;&quot; set VSSDKInstall=%VSSDK120Install%
557557
if &quot;%VSSDKInstall%&quot; == &quot;&quot; set VSSDKInstall=%VSSDK110Install%
558558
if &quot;%VSSDKInstall%&quot; == &quot;&quot; set VSSDKInstall=%VSSDK100Install%
@@ -566,17 +566,17 @@ goto reportError
566566
:no_VSCT
567567
echo Warning: VSCT.exe not found as %VSCT%
568568
echo It is part of the VS2010-VS2013 SDK and is needed to compile $(InputPath)
569-
:reportError" tool="Custom" outfile="$(InputDir)\$(InputName).cto" />
569+
:reportError" outfile="$(InputDir)\$(InputName).cto" />
570570
<File path="Resources\refresh.ico" />
571571
<File path="Resources\RegExp.ico" />
572572
<File path="Resources\removetrace.ico" />
573573
<File path="Resources\resources.h" />
574574
<File path="Resources\SearchFile.ico" />
575575
<File path="Resources\SearchSymbol.ico" />
576576
<File path="Resources\settrace.ico" />
577-
<File path="visuald.rc" customcmd="call &quot;$(VSINSTALLDIR)\Common7\Tools\vsvars32.bat&quot;
577+
<File tool="Custom" path="visuald.rc" dependencies="resources\pkgcmd.cto;resources\daboutlogo.ico;..\version;resources\dimagelist.bmp" customcmd="call &quot;$(VSINSTALLDIR)\Common7\Tools\vsvars32.bat&quot;
578578
rem if errorlevel 1 goto reportError
579-
rc /fo&quot;$(OutDir)\visuald.res&quot; $(InputPath)" tool="Custom" dependencies="resources\pkgcmd.cto;resources\daboutlogo.ico;..\version;resources\dimagelist.bmp" linkoutput="true" outfile="$(OutDir)\visuald.res" />
579+
rc /fo&quot;$(OutDir)\visuald.res&quot; $(InputPath)" outfile="$(OutDir)\visuald.res" linkoutput="true" />
580580
<File path="Resources\WholeWord.ico" />
581581
</Folder>
582582
<Folder name="Templates">
@@ -594,36 +594,36 @@ rc /fo&quot;$(OutDir)\visuald.res&quot; $(InputPath)" tool="Custom" dependencies
594594
<File path="Templates\CodeSnippets\SnippetsIndex.xml" />
595595
</Folder>
596596
<Folder name="Items">
597-
<File path="Templates\Items\empty.d" tool="None" />
598-
<File path="Templates\Items\hello.d" tool="None" />
597+
<File tool="None" path="Templates\Items\empty.d" />
598+
<File tool="None" path="Templates\Items\hello.d" />
599599
<File path="Templates\Items\items.vsdir" />
600600
</Folder>
601601
<Folder name="ProjectItems">
602602
<Folder name="ConsoleApp">
603603
<File path="Templates\ProjectItems\ConsoleApp\ConsoleApp.visualdproj" />
604604
<File path="Templates\ProjectItems\ConsoleApp\ConsoleApp.vstemplate" />
605-
<File path="Templates\ProjectItems\ConsoleApp\main.d" tool="None" />
605+
<File tool="None" path="Templates\ProjectItems\ConsoleApp\main.d" />
606606
</Folder>
607607
<Folder name="ConsoleDMDGDC">
608608
<File path="Templates\ProjectItems\ConsoleDMDGDC\ConsoleApp.visualdproj" />
609609
<File path="Templates\ProjectItems\ConsoleDMDGDC\ConsoleApp.vstemplate" />
610-
<File path="Templates\ProjectItems\ConsoleDMDGDC\main.d" tool="None" />
610+
<File tool="None" path="Templates\ProjectItems\ConsoleDMDGDC\main.d" />
611611
</Folder>
612612
<Folder name="DynamicLib">
613-
<File path="Templates\ProjectItems\DynamicLib\dll.def" tool="None" />
614-
<File path="Templates\ProjectItems\DynamicLib\dllmain.d" tool="None" />
613+
<File tool="None" path="Templates\ProjectItems\DynamicLib\dll.def" />
614+
<File tool="None" path="Templates\ProjectItems\DynamicLib\dllmain.d" />
615615
<File path="Templates\ProjectItems\DynamicLib\DynamicLib.visualdproj" />
616616
<File path="Templates\ProjectItems\DynamicLib\DynamicLib.vstemplate" />
617617
</Folder>
618618
<Folder name="StaticLib">
619-
<File path="Templates\ProjectItems\StaticLib\lib.d" tool="None" />
619+
<File tool="None" path="Templates\ProjectItems\StaticLib\lib.d" />
620620
<File path="Templates\ProjectItems\StaticLib\StaticLib.visualdproj" />
621621
<File path="Templates\ProjectItems\StaticLib\StaticLib.vstemplate" />
622622
</Folder>
623623
<Folder name="WindowsApp">
624624
<File path="Templates\ProjectItems\WindowsApp\WindowsApp.visualdproj" />
625625
<File path="Templates\ProjectItems\WindowsApp\WindowsApp.vstemplate" />
626-
<File path="Templates\ProjectItems\WindowsApp\winmain.d" tool="None" />
626+
<File tool="None" path="Templates\ProjectItems\WindowsApp\winmain.d" />
627627
</Folder>
628628
</Folder>
629629
<Folder name="Projects">

0 commit comments

Comments
 (0)