Skip to content

Commit 9a60dcf

Browse files
committed
Merge pull request #37 from rainers/master
Visual D 0.3.40 beta4
2 parents c7d5b14 + a3c026c commit 9a60dcf

25 files changed

+1322
-639
lines changed

CHANGES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,3 +686,14 @@ unreleased Version 0.3.40
686686
* really updated dparser to a6207d6db5e54c68aa4b9db53b702681242d81d5
687687
* goto definition on import now supports package.d
688688
* bugzilla 13759: $(VSINSTALLDIR)\Common7\IDE now added to the default executable paths
689+
* build phobos browse info: operated on outdated folder structure of phobos/druntime
690+
* DMD/x64 linker override settings not saved
691+
* revamped pipedmd: now uses tracker.exe from MSBuild or WinSDK to monitor dependencies
692+
* Win32/COFF support: check box on Compiler->Output page, new tab in global options
693+
* bugzilla 13817: VisualD cannot list members with utf-8 wide characters
694+
* bugzilla 13342: mixin error message now interpreted
695+
* when running/unittesting from within visuald, exception/callstack locations can be jumped to
696+
* bugzilla 13213: there are now both "goto definition" and "goto declaration", where the former
697+
will try to find the forward declared symbols through the object browser (including C/C++)
698+
* object browser/symbol search: now filters out __unittest and __invariant symbols
699+
* cv2pdb: updated to 0.33 with better DWARF location support

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ install: all cpp2d_exe idl2d_exe
163163
cd nsis && "$(NSIS)\makensis" /V1 visuald.nsi
164164
"$(ZIP)" -j ..\downloads\visuald_pdb.zip bin\release\visuald.pdb bin\release\vdserver.pdb
165165

166-
#prerequisites
167-
install_vs: visuald_vs vdserver cv2pdb dparser vdextension mago install_only
166+
install_vs: prerequisites visuald_vs vdserver cv2pdb dparser vdextension mago install_only
168167

169168
install_only:
170169
cd nsis && "$(NSIS)\makensis" /V1 visuald.nsi

TODO

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Project:
3333
- GDC:
3434
- separate compile + link does not write to object dir
3535
- ddoc files
36-
- additional options for resource compiler
36+
+ additional options for resource compiler
3737
- pass import path from static lib project to dependent projects
3838
- single file compilation for file configuration
3939
- custom command: quotes in dependencies not supported
@@ -167,3 +167,6 @@ Unsorted
167167
- jump to assertion error
168168
+ import std.container: jump to package
169169
- renaming configuration does not change project config
170+
+ win32coff support
171+
- file search: replace . with \ in path search?
172+
+ run cv2pdb disabled for GDC/x64

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 40
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 3
5+
#define VERSION_BUILD 4

build/build.visualdproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
<stackStomp>0</stackStomp>
5050
<compiler>0</compiler>
5151
<otherDMD>0</otherDMD>
52+
<cccmd>$(CC) -c</cccmd>
53+
<ccTransOpt>1</ccTransOpt>
5254
<program>$(DMDInstallDir)windows\bin\dmd.exe</program>
5355
<imppath />
5456
<fileImppath />
@@ -147,6 +149,8 @@
147149
<stackStomp>0</stackStomp>
148150
<compiler>0</compiler>
149151
<otherDMD>0</otherDMD>
152+
<cccmd>$(CC) -c</cccmd>
153+
<ccTransOpt>1</ccTransOpt>
150154
<program>$(DMDInstallDir)windows\bin\dmd.exe</program>
151155
<imppath />
152156
<fileImppath />
@@ -201,7 +205,7 @@ echo. &gt;$(TargetDir)\build.dep</postBuildCommand>
201205
<File tool="Custom" path="dte_idl.bat" dependencies="$(OutDir)\tlb2idl.exe" customcmd="call &quot;$(VSINSTALLDIR)\Common7\Tools\vsvars32.bat&quot;
202206
if errorlevel 1 goto reportError
203207
call $(InputPath) &quot;$(OutDir)\tlb2idl.exe&quot; &quot;$(OutDir)\dte_idl.success&quot;" outfile="$(OutDir)\dte_idl.success" />
204-
<File tool="Custom" path="..\tools\filemonitor.d" customcmd="dmd -map $(OutDir)\$(InputName).map -of$(OutDir)\$(InputName).dll -defaultlib=user32.lib -L/ENTRY:_DllMain@12 $(InputPath)" outfile="$(OutDir)\$(InputName).dll" />
208+
<File tool="Custom" path="..\tools\filemonitor.d" customcmd="dmd -g -map $(OutDir)\$(InputName).map -of$(OutDir)\$(InputName).dll -defaultlib=user32.lib -L/ENTRY:_DllMain@12 $(InputPath)" outfile="$(OutDir)\$(InputName).dll" />
205209
<File tool="Custom" path="..\tools\largeadr.d" customcmd="dmd -map $(OutDir)\$(InputName).map -of$(OutDir)\$(InputName).exe $(InputPath)" outfile="$(OutDir)\$(InputName).exe" />
206210
<File tool="Custom" path="..\tools\pipedmd.d" dependencies="..\tools\nostacktrace.d" customcmd="dmd -map $(OutDir)\$(InputName).map -of$(OutDir)\$(InputName).exe $(InputPath) ..\tools\nostacktrace.d" outfile="$(OutDir)\$(InputName).exe" />
207211
<File tool="Custom" path="sdk.bat" dependencies="$(OutDir)\dte_idl.success $(OutDir)\vsi2d.exe" customcmd="call &quot;$(VSINSTALLDIR)\Common7\Tools\vsvars32.bat&quot;

stdext/registry.d

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
module stdext.registry;
2+
3+
import stdext.com;
4+
5+
import sdk.win32.winreg;
6+
import sdk.port.base;
7+
8+
enum { SECURE_ACCESS = ~(WRITE_DAC | WRITE_OWNER | GENERIC_ALL | ACCESS_SYSTEM_SECURITY) }
9+
10+
/*---------------------------------------------------------
11+
Registry helpers
12+
-----------------------------------------------------------*/
13+
HRESULT RegQueryValue(HKEY root, in wstring keyname, in wstring valuename, ref wstring value)
14+
{
15+
HKEY key;
16+
HRESULT hr = hrRegOpenKeyEx(root, keyname, 0, KEY_READ, &key);
17+
if(FAILED(hr))
18+
return hr;
19+
scope(exit) RegCloseKey(key);
20+
21+
wchar[260] buf;
22+
DWORD cnt = 260 * wchar.sizeof;
23+
wchar* szName = _toUTF16zw(valuename);
24+
DWORD type;
25+
hr = RegQueryValueExW(key, szName, null, &type, cast(ubyte*) buf.ptr, &cnt);
26+
if(hr == S_OK && cnt > 0)
27+
value = to_wstring(buf.ptr);
28+
if(hr != ERROR_MORE_DATA)
29+
return HRESULT_FROM_WIN32(hr);
30+
if (type != REG_SZ)
31+
return ERROR_DATATYPE_MISMATCH;
32+
33+
scope wchar[] pbuf = new wchar[cnt/2 + 1];
34+
hr = RegQueryValueExW(key, szName, null, &type, cast(ubyte*) pbuf.ptr, &cnt);
35+
if(hr == S_OK)
36+
value = to_wstring(pbuf.ptr);
37+
return HRESULT_FROM_WIN32(hr);
38+
}
39+
40+
HRESULT RegCreateValue(HKEY key, in wstring name, in wstring value)
41+
{
42+
wstring szName = name ~ cast(wchar)0;
43+
wstring szValue = value ~ cast(wchar)0;
44+
DWORD dwDataSize = value is null ? 0 : wchar.sizeof * (value.length+1);
45+
LONG lRetCode = RegSetValueExW(key, szName.ptr, 0, REG_SZ, cast(ubyte*)(szValue.ptr), dwDataSize);
46+
return HRESULT_FROM_WIN32(lRetCode);
47+
}
48+
49+
HRESULT RegCreateDwordValue(HKEY key, in wstring name, in DWORD value)
50+
{
51+
wstring szName = name ~ cast(wchar)0;
52+
LONG lRetCode = RegSetValueExW(key, szName.ptr, 0, REG_DWORD, cast(ubyte*)(&value), value.sizeof);
53+
return HRESULT_FROM_WIN32(lRetCode);
54+
}
55+
56+
HRESULT RegCreateQwordValue(HKEY key, in wstring name, in long value)
57+
{
58+
wstring szName = name ~ cast(wchar)0;
59+
LONG lRetCode = RegSetValueExW(key, szName.ptr, 0, REG_QWORD, cast(ubyte*)(&value), value.sizeof);
60+
return HRESULT_FROM_WIN32(lRetCode);
61+
}
62+
63+
HRESULT RegCreateBinaryValue(HKEY key, in wstring name, in void[] data)
64+
{
65+
wstring szName = name ~ cast(wchar)0;
66+
LONG lRetCode = RegSetValueExW(key, szName.ptr, 0, REG_BINARY, cast(ubyte*)data.ptr, data.length);
67+
return HRESULT_FROM_WIN32(lRetCode);
68+
}
69+
70+
HRESULT RegDeleteRecursive(HKEY keyRoot, wstring path)
71+
{
72+
HRESULT hr;
73+
HKEY key;
74+
ULONG subKeys = 0;
75+
ULONG maxKeyLen = 0;
76+
ULONG currentKey = 0;
77+
wstring[] keyNames;
78+
79+
hr = hrRegOpenKeyEx(keyRoot, path, 0, (KEY_READ & SECURE_ACCESS), &key);
80+
if (!FAILED(hr))
81+
{
82+
LONG lRetCode = RegQueryInfoKeyW(key, null, null, null, &subKeys, &maxKeyLen,
83+
null, null, null, null, null, null);
84+
if (ERROR_SUCCESS != lRetCode)
85+
{
86+
hr = HRESULT_FROM_WIN32(lRetCode);
87+
}
88+
else if (subKeys > 0)
89+
{
90+
wchar[] keyName = new wchar[maxKeyLen+1];
91+
for (currentKey = 0; currentKey < subKeys; currentKey++)
92+
{
93+
ULONG keyLen = maxKeyLen+1;
94+
lRetCode = RegEnumKeyExW(key, currentKey, keyName.ptr, &keyLen, null, null, null, null);
95+
if (ERROR_SUCCESS == lRetCode)
96+
keyNames ~= to_wstring(keyName.ptr, keyLen);
97+
}
98+
foreach(wstring subkey; keyNames)
99+
RegDeleteRecursive(key, subkey);
100+
}
101+
}
102+
fail:
103+
wstring szPath = path ~ cast(wchar)0;
104+
LONG lRetCode = RegDeleteKeyW(keyRoot, szPath.ptr);
105+
if (SUCCEEDED(hr) && (ERROR_SUCCESS != lRetCode))
106+
hr = HRESULT_FROM_WIN32(lRetCode);
107+
if (key) RegCloseKey(key);
108+
return hr;
109+
}
110+
111+
HRESULT hrRegOpenKeyEx(HKEY root, wstring regPath, int reserved, REGSAM samDesired, HKEY* phkResult)
112+
{
113+
wchar* szRegPath = _toUTF16zw(regPath);
114+
LONG lRes = RegOpenKeyExW(root, szRegPath, 0, samDesired, phkResult);
115+
return HRESULT_FROM_WIN32(lRes);
116+
}
117+
118+
HRESULT hrRegCreateKeyEx(HKEY keySub, wstring regPath, int reserved, wstring classname, DWORD opt, DWORD samDesired,
119+
SECURITY_ATTRIBUTES* security, HKEY* key, DWORD* disposition)
120+
{
121+
wchar* szRegPath = _toUTF16zw(regPath);
122+
wchar* szClassname = _toUTF16zw(classname);
123+
LONG lRes = RegCreateKeyExW(keySub, szRegPath, 0, szClassname, opt, samDesired, security, key, disposition);
124+
return HRESULT_FROM_WIN32(lRes);
125+
}

0 commit comments

Comments
 (0)