From e2da5f2d28232e26f98ea9fddcb3065a9a1f9976 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 19 Jun 2019 01:18:15 +0900 Subject: [PATCH 1/3] Remove trailing whitespace --- src/mecca/lib/exception.d | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mecca/lib/exception.d b/src/mecca/lib/exception.d index b40de0e..f1593bb 100644 --- a/src/mecca/lib/exception.d +++ b/src/mecca/lib/exception.d @@ -702,8 +702,3 @@ unittest { // double close will throw assertThrows!ErrnoException(errnoCall!close(newFd)); } - - - - - From d77d86f3542b19c904c93d5d577330f915fcc5ab Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 19 Jun 2019 01:18:04 +0900 Subject: [PATCH 2/3] Document the (likely) reason for the hack --- src/mecca/lib/exception.d | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mecca/lib/exception.d b/src/mecca/lib/exception.d index f1593bb..1f97d80 100644 --- a/src/mecca/lib/exception.d +++ b/src/mecca/lib/exception.d @@ -27,6 +27,7 @@ import mecca.lib.string : nogcFormat, nogcRtFormat; private bool _assertInProgress; +// The default TraceInfo provided by DMD is not `@nogc` private extern(C) nothrow @nogc { int backtrace(void** buffer, int size); From 7ba53943b587b0cda49581b638f4ef28e9b8d8fb Mon Sep 17 00:00:00 2001 From: Geod24 Date: Wed, 19 Jun 2019 01:21:31 +0900 Subject: [PATCH 3/3] Add new DefaultTraceInfo ctor mangling following PR2645 --- src/mecca/lib/exception.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mecca/lib/exception.d b/src/mecca/lib/exception.d index 1f97d80..6508dac 100644 --- a/src/mecca/lib/exception.d +++ b/src/mecca/lib/exception.d @@ -34,9 +34,12 @@ private extern(C) nothrow @nogc { static if (__VERSION__ < 2077) { pragma(mangle, "_D4core7runtime19defaultTraceHandlerFPvZ16DefaultTraceInfo6__ctorMFZC4core7runtime19defaultTraceHandlerFPvZ16DefaultTraceInfo") void defaultTraceInfoCtor(Object); - } else { + } else static if (__VERSION__ < 2087) { pragma(mangle, "_D4core7runtime19defaultTraceHandlerFPvZ16DefaultTraceInfo6__ctorMFZCQCpQCnQCiFQBqZQBr") void defaultTraceInfoCtor(Object); + } else { + pragma(mangle, "_D4core7runtime16DefaultTraceInfo6__ctorMFZCQBqQBoQBj") + void defaultTraceInfoCtor(Object); } } private __gshared static TypeInfo_Class defaultTraceTypeInfo;