redefine extern(C) function in a shared library

timotheecour thelastmammoth at gmail.com
Thu Oct 4 00:20:15 PDT 2012


Here, I want to redefine an extern(C) function, not call the 
existing definition. I mentioned my previous post because I 
realized that when adding (for example) assert(0) inside the 
definition extern(C) std_stdio_static_this, it had no effect, 
which led me to ask this more general question: how to redefine 
an extern(C) function in a shared lib, which is very often needed 
(eg handling asserts, stacktraces, redirecting io to a log etc). 
It does work inside a normal D program.
Interestingly, I also tried linking against a library libredefine 
that just re-defines that extern(C) symbol BEFORE linking against 
libphobos2.a, but that too had no effect. weird.
(it was something like: rdmd -lredefine -L-Lpath/to/phobos etc)




More information about the Digitalmars-d-learn mailing list