Just don't call Pike_error() from a function with C++ linkage (either directly or indirectly) and you should be fine, I think. I.e. do
extern "C" void f_foo(INT32 args) { /* Process arguments using only "C" code */
/* Call C++ code, which does not used any pike functions */
/* Convert result to Pike datatypes using "C" code, possibly calling Pike_error() */ }
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-02-27 12:52: Subject: Re: modules in C++?
On Tue, Feb 17, 2004 at 11:05:03AM +0100, Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
extern "C" { #include "whatever.h" }
Make sure to not throw any C++ exceptions though.
There is another problem, which might clash with C++ exception handling (and possibly others).
Pike_error() uses longjmp(), which is not recommended to be used in C++ runtime... And this is, IMHO, unavoidable...
Regards, /Al
/ Brevbäraren