Re: how to catch D Throwables (or exceptions) from C++?

2016-12-02 Thread Elie Morisse via Digitalmars-d-learn
On Friday, 2 December 2016 at 08:13:51 UTC, Jacob Carlborg wrote: On 2016-12-01 02:58, Timothee Cour via Digitalmars-d-learn wrote: eg: ``` dlib.d: extern(C) void dfun(){assert(0, "some_msg");} clib.cpp: extern "C" void dfun(); void fun(){ try{ dfun(); } catch(...){ // works but

Re: how to catch D Throwables (or exceptions) from C++?

2016-12-02 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-12-01 02:58, Timothee Cour via Digitalmars-d-learn wrote: eg: ``` dlib.d: extern(C) void dfun(){assert(0, "some_msg");} clib.cpp: extern "C" void dfun(); void fun(){ try{ dfun(); } catch(...){ // works but how do i get "some_msg" thrown from D? } } ``` At least for a

Re: how to catch D Throwables (or exceptions) from C++?

2016-12-01 Thread Rémy Mouëza via Digitalmars-d-learn
On Thursday, 1 December 2016 at 01:58:13 UTC, Timothee Cour wrote: eg: ``` dlib.d: extern(C) void dfun(){assert(0, "some_msg");} clib.cpp: extern "C" void dfun(); void fun(){ try{ dfun(); } catch(...){ // works but how do i get "some_msg" thrown from D? } } ``` I had the a

Re: how to catch D Throwables (or exceptions) from C++?

2016-11-30 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 1 December 2016 at 01:58:13 UTC, Timothee Cour wrote: eg: ``` dlib.d: extern(C) void dfun(){assert(0, "some_msg");} clib.cpp: extern "C" void dfun(); void fun(){ try{ dfun(); } catch(...){ // works but how do i get "some_msg" thrown from D? } } ``` portably not

how to catch D Throwables (or exceptions) from C++?

2016-11-30 Thread Timothee Cour via Digitalmars-d-learn
eg: ``` dlib.d: extern(C) void dfun(){assert(0, "some_msg");} clib.cpp: extern "C" void dfun(); void fun(){ try{ dfun(); } catch(...){ // works but how do i get "some_msg" thrown from D? } } ```