When to call setAssertHandler?

Benjamin Thaut code at benjamin-thaut.de
Tue Mar 26 11:35:39 PDT 2013


Am 26.03.2013 10:09, schrieb Jacob Carlborg:
> On 2013-03-22 10:58, Benjamin Thaut wrote:
>> So I want to install my own assertHandler. The problem is, that even if
>> I call "setAssetHandler" in a shared module constructor, and that module
>> does not import any other modules, it is still not initialized first. Is
>> there a way to set the assert before any module constructors run without
>> hacking druntime?
>
> As a workaround you could try overriding "onAssertError" and/or
> "onAssertErrorMsg".
>
> https://github.com/D-Programming-Language/druntime/blob/master/src/core/exception.d#L393
>
>

Yes, but this workaround does not work for windows 64 bit as the 
microsoft linker complains about duplicate symbols. Also I think it will 
only work with dmd because all other compiles (I tested with gdc) also 
complain about duplicate symbols.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d-learn mailing list