Skip to content

Commit f97595a

Browse files
committed
* additional options: now replacing newline with space when adding to the command line
* compiling file for syntax check with LDC passed wrong command line option
1 parent 4628c2a commit f97595a

File tree

5 files changed

+64
-46
lines changed

5 files changed

+64
-46
lines changed

CHANGES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,3 +788,14 @@ unreleased Version 0.3.43
788788
that also contains a Visual D project
789789
* VS2015 linker updates logs and telemetry data files, confusing tracked linker dependencies.
790790
Now ignoring files that are both read and written.
791+
* debug option: allow none of -debug and -release to be specified (and fix LDC never to receive
792+
the -d-debug option)
793+
* some improvements to the C++ to D conversion wizard:
794+
- don't stop conversion after an unmatched } (this also caused other messages to not be displayed)
795+
- added support for sizeof without parenthesis
796+
- allow namespace scope in type names
797+
- allow virtual destructors
798+
- skip throw function specification
799+
- fix order of identifiers if "#define A B" is converted to an alias
800+
* additional options: now replacing newline with space when adding to the command line
801+
* compiling file for syntax check with LDC passed wrong command line option

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define VERSION_MAJOR 0
22
#define VERSION_MINOR 3
33
#define VERSION_REVISION 43
4-
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 2
4+
#define VERSION_BETA -rc
5+
#define VERSION_BUILD 1

visuald/comutil.d

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public import stdext.com;
2323
import sdk.win32.oleauto;
2424
import sdk.win32.objbase;
2525

26-
debug debug = COM;
27-
// debug(COM) debug = COM_DTOR; // causes crashes because logCall needs GC, but finalizer called from within GC
28-
// debug(COM) debug = COM_ADDREL;
26+
//debug debug = COM;
27+
//debug(COM) debug = COM_DTOR; // causes crashes because logCall needs GC, but finalizer called from within GC
28+
//debug(COM) debug = COM_ADDREL;
2929

3030
import core.runtime;
3131
//debug(COM_ADDREL) debug static import rsgc.gc;
@@ -103,8 +103,8 @@ debug
103103
// logCall needs GC, but finalizer called from within GC
104104
void* vthis = cast(void*) this;
105105
debug(COM_DTOR) logCall("dtor %s this = %s", this, vthis);
106-
debug(COM_ADDREL)
107-
synchronized(DComObject.classinfo)
106+
debug(COM_ADDREL)
107+
synchronized(DComObject.classinfo)
108108
if(auto p = (cast(size_t)vthis^WEAK_PTR_XOR) in sReferencedObjects)
109109
*p = -1;
110110
InterlockedDecrement(&sCountInstances);
@@ -118,7 +118,7 @@ debug
118118
sprintf(sbuf.ptr, "%d COM objects created\n", sCountCreated); ods(sbuf.ptr);
119119
sprintf(sbuf.ptr, "%d COM objects never destroyed (no final collection run yet!)\n", sCountInstances); ods(sbuf.ptr);
120120
sprintf(sbuf.ptr, "%d COM objects not fully dereferenced\n", sCountReferenced); ods(sbuf.ptr);
121-
debug(COM_ADDREL)
121+
debug(COM_ADDREL)
122122
foreach(p, b; sReferencedObjects)
123123
{
124124
void* q = cast(void*)(p^WEAK_PTR_XOR);
@@ -175,14 +175,14 @@ version(none) // copy for debugging
175175
{
176176
LONG lRef = super.AddRef();
177177
debug(COM_ADDREL) logCall("addref %s this = %s ref = %d", this, cast(void*)this, lRef);
178-
178+
179179
if(lRef == 1)
180180
{
181181
debug InterlockedIncrement(&sCountReferenced);
182182
//uint sz = this.classinfo.init.length;
183183
debug void* vthis = cast(void*) this;
184184
debug(COM) logCall("addroot %s this = %s", this, vthis);
185-
debug(COM_ADDREL)
185+
debug(COM_ADDREL)
186186
synchronized(DComObject.classinfo) sReferencedObjects[cast(size_t)vthis^WEAK_PTR_XOR] = 1;
187187
}
188188
return lRef;
@@ -193,13 +193,13 @@ version(none) // copy for debugging
193193
ULONG lRef = super.Release();
194194

195195
debug(COM_ADDREL) logCall("release %s this = %s ref = %d", this, cast(void*)this, lRef);
196-
196+
197197
if (lRef == 0)
198198
{
199199
debug void* vthis = cast(void*) this;
200200
debug(COM) logCall("delroot %s this = %s", this, vthis);
201201
debug InterlockedDecrement(&sCountReferenced);
202-
debug(COM_ADDREL)
202+
debug(COM_ADDREL)
203203
synchronized(DComObject.classinfo) sReferencedObjects[cast(size_t)vthis^WEAK_PTR_XOR] = 0;
204204
}
205205
return lRef;
@@ -227,13 +227,13 @@ class DisposingComObject : DComObject
227227
}
228228

229229
/+
230-
struct PARAMDATA
230+
struct PARAMDATA
231231
{
232232
OLECHAR* szName;
233233
VARTYPE vtReturn;
234234
}
235235
236-
struct METHODDATA
236+
struct METHODDATA
237237
{
238238
OLECHAR* zName;
239239
PARAMDATA* ppData;
@@ -248,7 +248,7 @@ struct METHODDATA
248248
struct INTERFACEDATA
249249
{
250250
METHODDATA* pmethdata; // Pointer to an array of METHODDATAs.
251-
uint cMembers; // Count of
251+
uint cMembers; // Count of
252252
}
253253
+/
254254

@@ -262,15 +262,15 @@ class DisposingDispatchObject : DisposingComObject, IDispatch
262262
}
263263

264264
// IDispatch
265-
override int GetTypeInfoCount(
265+
override int GetTypeInfoCount(
266266
/* [out] */ UINT *pctinfo)
267267
{
268268
// mixin(LogCallMix);
269269
*pctinfo = 1;
270270
return S_OK;
271271
}
272272

273-
override int GetTypeInfo(
273+
override int GetTypeInfo(
274274
/* [in] */ in UINT iTInfo,
275275
/* [in] */ in LCID lcid,
276276
/* [out] */ ITypeInfo *ppTInfo)
@@ -283,7 +283,7 @@ class DisposingDispatchObject : DisposingComObject, IDispatch
283283
return S_OK;
284284
}
285285

286-
override int GetIDsOfNames(
286+
override int GetIDsOfNames(
287287
/* [in] */ in IID* riid,
288288
/* [size_is][in] */ in LPOLESTR *rgszNames,
289289
/* [range][in] */ in UINT cNames,
@@ -294,7 +294,7 @@ class DisposingDispatchObject : DisposingComObject, IDispatch
294294
return getTypeHolder().GetIDsOfNames(rgszNames, cNames, rgDispId);
295295
}
296296

297-
override int Invoke(
297+
override int Invoke(
298298
/* [in] */ in DISPID dispIdMember,
299299
/* [in] */ in IID* riid,
300300
/* [in] */ in LCID lcid,
@@ -334,37 +334,37 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
334334
return super.QueryInterface(riid, pvObject);
335335
}
336336

337-
override int GetTypeAttr(
337+
override int GetTypeAttr(
338338
/* [out] */ TYPEATTR **ppTypeAttr)
339339
{
340340
mixin(LogCallMix);
341341
return returnError(E_NOTIMPL);
342342
}
343343

344-
override int GetTypeComp(
344+
override int GetTypeComp(
345345
/* [out] */ ITypeComp* ppTComp)
346346
{
347347
mixin(LogCallMix);
348348
return returnError(E_NOTIMPL);
349349
}
350350

351-
override int GetFuncDesc(
351+
override int GetFuncDesc(
352352
/* [in] */ in UINT index,
353353
/* [out] */ FUNCDESC **ppFuncDesc)
354354
{
355355
mixin(LogCallMix);
356356
return returnError(E_NOTIMPL);
357357
}
358358

359-
override int GetVarDesc(
359+
override int GetVarDesc(
360360
/* [in] */ in UINT index,
361361
/* [out] */ VARDESC **ppVarDesc)
362362
{
363363
mixin(LogCallMix);
364364
return returnError(E_NOTIMPL);
365365
}
366366

367-
override int GetNames(
367+
override int GetNames(
368368
/* [in] */ in MEMBERID memid,
369369
/* [length_is][size_is][out] */ BSTR *rgBstrNames,
370370
/* [in] */ in UINT cMaxNames,
@@ -374,23 +374,23 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
374374
return returnError(E_NOTIMPL);
375375
}
376376

377-
override int GetRefTypeOfImplType(
377+
override int GetRefTypeOfImplType(
378378
/* [in] */ in UINT index,
379379
/* [out] */ HREFTYPE *pRefType)
380380
{
381381
mixin(LogCallMix);
382382
return returnError(E_NOTIMPL);
383383
}
384384

385-
override int GetImplTypeFlags(
385+
override int GetImplTypeFlags(
386386
/* [in] */ in UINT index,
387387
/* [out] */ INT *pImplTypeFlags)
388388
{
389389
mixin(LogCallMix);
390390
return returnError(E_NOTIMPL);
391391
}
392392

393-
override int GetIDsOfNames(
393+
override int GetIDsOfNames(
394394
/* [size_is][in] */ in LPOLESTR *rgszNames,
395395
/* [in] */ in UINT cNames,
396396
/* [size_is][out] */ MEMBERID *pMemId)
@@ -399,7 +399,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
399399
return returnError(E_NOTIMPL);
400400
}
401401

402-
override int Invoke(
402+
override int Invoke(
403403
/* [in] */ in PVOID pvInstance,
404404
/* [in] */ in MEMBERID memid,
405405
/* [in] */ in WORD wFlags,
@@ -412,7 +412,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
412412
return returnError(E_NOTIMPL);
413413
}
414414

415-
override int GetDocumentation(
415+
override int GetDocumentation(
416416
/* [in] */ in MEMBERID memid,
417417
/* [out] */ BSTR *pBstrName,
418418
/* [out] */ BSTR *pBstrDocString,
@@ -423,7 +423,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
423423
return returnError(E_NOTIMPL);
424424
}
425425

426-
override int GetDllEntry(
426+
override int GetDllEntry(
427427
/* [in] */ in MEMBERID memid,
428428
/* [in] */ in INVOKEKIND invKind,
429429
/* [out] */ BSTR *pBstrDllName,
@@ -434,15 +434,15 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
434434
return returnError(E_NOTIMPL);
435435
}
436436

437-
override int GetRefTypeInfo(
437+
override int GetRefTypeInfo(
438438
/* [in] */ in HREFTYPE hRefType,
439439
/* [out] */ ITypeInfo* ppTInfo)
440440
{
441441
mixin(LogCallMix);
442442
return returnError(E_NOTIMPL);
443443
}
444444

445-
override int AddressOfMember(
445+
override int AddressOfMember(
446446
/* [in] */ in MEMBERID memid,
447447
/* [in] */ in INVOKEKIND invKind,
448448
/* [out] */ PVOID *ppv)
@@ -451,7 +451,7 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
451451
return returnError(E_NOTIMPL);
452452
}
453453

454-
override int CreateInstance(
454+
override int CreateInstance(
455455
/* [in] */ IUnknown pUnkOuter,
456456
/* [in] */ in IID* riid,
457457
/* [iid_is][out] */ PVOID *ppvObj)
@@ -460,37 +460,37 @@ class ComTypeInfoHolder : DComObject, ITypeInfo
460460
return returnError(E_NOTIMPL);
461461
}
462462

463-
override int GetMops(
463+
override int GetMops(
464464
/* [in] */ in MEMBERID memid,
465465
/* [out] */ BSTR *pBstrMops)
466466
{
467467
mixin(LogCallMix2);
468468
return returnError(E_NOTIMPL);
469469
}
470470

471-
override int GetContainingTypeLib(
471+
override int GetContainingTypeLib(
472472
/* [out] */ ITypeLib *ppTLib,
473473
/* [out] */ UINT *pIndex)
474474
{
475475
mixin(LogCallMix2);
476476
return returnError(E_NOTIMPL);
477477
}
478478

479-
/* [local] */ void ReleaseTypeAttr(
479+
/* [local] */ void ReleaseTypeAttr(
480480
/* [in] */ in TYPEATTR *pTypeAttr)
481481
{
482482
mixin(LogCallMix);
483483
//return returnError(E_NOTIMPL);
484484
}
485485

486-
/* [local] */ void ReleaseFuncDesc(
486+
/* [local] */ void ReleaseFuncDesc(
487487
/* [in] */ in FUNCDESC *pFuncDesc)
488488
{
489489
mixin(LogCallMix);
490490
//return returnError(E_NOTIMPL);
491491
}
492492

493-
/* [local] */ void ReleaseVarDesc(
493+
/* [local] */ void ReleaseVarDesc(
494494
/* [in] */ in VARDESC *pVarDesc)
495495
{
496496
mixin(LogCallMix);

visuald/config.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ class ProjectOptions
897897
return s;
898898
}
899899

900-
inioptions ~= " " ~ additionalOptions;
900+
inioptions ~= " " ~ additionalOptions.replace("\n", " ");
901901
string[] opts = tokenizeArgs(inioptions, false);
902902
opts = expandResponseFiles(opts, workdir);
903903
string addopts;
@@ -1086,7 +1086,7 @@ class ProjectOptions
10861086
if(compiler != Compiler.DMD && lib == OutputType.StaticLib)
10871087
return ""; // no options to ar
10881088

1089-
return additionalOptions; // always filtered through compiler
1089+
return additionalOptions.replace("\n", " "); // always filtered through compiler
10901090
}
10911091

10921092
string getTargetPath()
@@ -2852,10 +2852,10 @@ class Config : DisposingComObject,
28522852
string depfile = GetOutputFile(file, tool) ~ ".dep";
28532853
cmd = "echo Compiling " ~ file.GetFilename() ~ "...\n";
28542854
cmd ~= mProjectOptions.buildCommandLine(true, false, false, syntaxOnly);
2855-
if(syntaxOnly && mProjectOptions.compiler == Compiler.DMD)
2856-
cmd ~= " -c -o-";
2857-
else if(syntaxOnly)
2855+
if(syntaxOnly && mProjectOptions.compiler == Compiler.GDC)
28582856
cmd ~= " -c -fsyntax-only";
2857+
else if(syntaxOnly)
2858+
cmd ~= " -c -o-";
28592859
else
28602860
cmd ~= " -c " ~ mProjectOptions.getOutputFileOption(outfile)
28612861
~ mProjectOptions.getDependenciesFileOption(depfile);
@@ -3310,7 +3310,7 @@ class Config : DisposingComObject,
33103310
}
33113311
string addopt;
33123312
if(mProjectOptions.additionalOptions.length && fcmd.length)
3313-
addopt = " " ~ mProjectOptions.additionalOptions;
3313+
addopt = " " ~ mProjectOptions.additionalOptions.replace("\n", " ");
33143314
string cmd = precmd ~ opt ~ fcmd ~ addopt ~ "\n";
33153315
cmd = cmd ~ "if errorlevel 1 goto reportError\n";
33163316

visuald/propertypage.d

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ abstract class PropertyPage : DisposingComObject, IPropertyPage, IVsPropertyPage
206206
mResizableWidgets[w] = attData;
207207
}
208208

209+
void refreshResizableWidget(Widget w)
210+
{
211+
if (auto att = w in mResizableWidgets)
212+
att.initFromWidget(w);
213+
}
214+
209215
void addTextPath(Text ctrl, string path, string sep)
210216
{
211217
string imp = ctrl.getText();
@@ -881,6 +887,7 @@ class DebuggingPropertyPage : ProjectPropertyPage
881887
int left, top, w, h;
882888
if(lbl.getRect(left, top, w, h))
883889
lbl.setRect(left, top + h / 2 - 1, w, 2);
890+
refreshResizableWidget(lbl);
884891
}
885892

886893
override void UpdateDirty(bool bDirty)
@@ -1060,8 +1067,8 @@ class DmdDebugPropertyPage : ProjectPropertyPage
10601067
override void CreateControls()
10611068
{
10621069
string[] dbgInfoOpt = [ "None", "Symbolic (suitable for Mago)", "Symbolic (suitable for VS debug engine)", "Symbolic (suitable for selected debug engine)" ];
1063-
AddControl("Debug Mode", mDebugMode = new ComboBox(mCanvas, [ "Off (disable asserts, invariants and constraints)",
1064-
"On (enable debug statements, asserts, invariants and constraints)",
1070+
AddControl("Debug Mode", mDebugMode = new ComboBox(mCanvas, [ "On (enable debug statements, asserts, invariants and constraints)",
1071+
"Off (disable asserts, invariants and constraints)",
10651072
"Default (enable asserts, invariants and constraints)" ], false));
10661073
AddControl("Debug Info", mDebugInfo = new ComboBox(mCanvas, dbgInfoOpt, false));
10671074
AddHorizontalLine();

0 commit comments

Comments
 (0)