At 11:40 30.04.02 +0200, Pierre Pronchery wrote:
>question: can I use both C and C++ in a Dia plugin?
>else, can I use C++, or do I have to use C?
>
There already is one Dia plug-in compiles as C++ (wmf).
The only real C++ feature used/needed there is namespaces
to avoid clashes between Dia's and Windoze namespace
pollutions :)
Such thing should be possible with any decent GNU compiler
cause interfacing between modules in both languages are
a fundamental part of the C++ specification. Obviously
the interface part needs to restrict to "C" then. [The
C++ specification does not include an ABI specification.
It's compiler specific.]
The wmf plug-in is somewhat dirty with respect to the use
of ../render.inc without any extern "C". Though it works
fine because the interchanged function pointer are
compatible.
If you experience problems in the link step from differnt
name mangling an
extern "C"
PluginInitResult
dia_plugin_init(PluginInfo *info)
{
/* ... */
}
should do the trick.
Regards,
Hans
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it. -- Dilbert