xxxajk
Well-known member
Why worry about C when you can just use C++ callbacks from C. That is what I do and then I get the benefits from either.
Yes, you would still need to compile some of the core with G++, but who cares if you still get a C API anyway?
Basically speaking all you need to do is disable the name mangling in the cpp file to get the C API... you do this with:
extern "C" {
// whatever mixed C with access to C++ namespaces, etc...
}
...and the same goes in the header file, with the needed #ifdef for C++, Simple, really.
Yes, you would still need to compile some of the core with G++, but who cares if you still get a C API anyway?
Basically speaking all you need to do is disable the name mangling in the cpp file to get the C API... you do this with:
extern "C" {
// whatever mixed C with access to C++ namespaces, etc...
}
...and the same goes in the header file, with the needed #ifdef for C++, Simple, really.