Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Commit 0898f59

Browse files
committed
Fix gcc.backtrace to be compatible with DIP 1000
1 parent 3992982 commit 0898f59

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

libphobos/libdruntime/core/runtime.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ extern (C) bool runModuleUnitTests()
491491
// First frame is LibBacktrace ctor. Second is signal handler, but include that for now
492492
bt.__ctor(1);
493493

494-
foreach(size_t i, const(char[]) msg; bt)
494+
foreach (size_t i, const(char[]) msg; bt)
495495
fprintf(stderr, "%s\n", msg.ptr ? msg.ptr : "???");
496496
}
497497

libphobos/libdruntime/gcc/backtrace.d

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
153153
/*
154154
* The callback type used with the opApply overload which returns a SymbolOrError
155155
*/
156-
private alias scope int delegate(ref size_t, ref SymbolOrError) ApplyCallback;
156+
private alias int delegate(ref size_t, ref SymbolOrError) ApplyCallback;
157157

158158
/*
159159
* Passed to syminfoCallback, pcinfoCallback and pcinfoErrorCallback
@@ -228,20 +228,20 @@ static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
228228

229229
override int opApply(scope int delegate(ref const(char[])) dg) const
230230
{
231-
return opApply((ref size_t, ref const(char[]) buf)
231+
return opApply( (ref size_t, ref const(char[]) buf)
232232
{
233233
return dg(buf);
234234
});
235235
}
236236

237237
override int opApply(scope int delegate(ref size_t, ref const(char[])) dg) const
238238
{
239-
return opApply((ref size_t i, ref SymbolOrError sym)
239+
return opApply( (ref size_t i, ref SymbolOrError sym)
240240
{
241-
char[512] buffer = '\0';
242-
char[] msg;
243-
if (sym.errnum != 0)
244-
{
241+
char[512] buffer = '\0';
242+
char[] msg;
243+
if (sym.errnum != 0)
244+
{
245245
auto retval = snprintf(buffer.ptr, buffer.length,
246246
"libbacktrace error: '%s' errno: %d", sym.msg, sym.errnum);
247247
if (retval >= buffer.length)
@@ -257,7 +257,7 @@ static if (BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC)
257257
});
258258
}
259259

260-
int opApply(ApplyCallback dg) const
260+
int opApply(scope ApplyCallback dg) const
261261
{
262262
//If backtrace_simple produced an error report it and exit
263263
if (!state || error != 0)
@@ -352,7 +352,7 @@ else
352352

353353
override int opApply(scope int delegate(ref const(char[])) dg) const
354354
{
355-
return opApply((ref size_t, ref const(char[]) buf)
355+
return opApply( (ref size_t, ref const(char[]) buf)
356356
{
357357
return dg(buf);
358358
});
@@ -485,7 +485,7 @@ struct SymbolInfo
485485
* Format one output line for symbol sym.
486486
* Returns a slice of fixbuf.
487487
*/
488-
char[] formatLine(const SymbolInfo sym, ref char[512] fixbuf)
488+
char[] formatLine(const SymbolInfo sym, return ref char[512] fixbuf)
489489
{
490490
import core.demangle, core.stdc.config;
491491
import core.stdc.stdio : snprintf, printf;

0 commit comments

Comments
 (0)