EDIT: Never mind, I can't do this with the two types I mention below; they're of different sizes.
I'm trying to put together a Box2D wrapper, but I'd like users of it to be able to interface with it using the built-in basic2d.Vector2d type instead of b2Vec2.
I'm mainly asking on StackOverflow, but I'm asking here to increase exposure. The original post, with more details, is here. <http://stackoverflow.com/q/33789764/1089957>_</s>
Use c2nim's {. .} syntax to import basic2d into your modified header file and ensure the C++ class is mapped to the name Vector2d. Or you modify the generated Nim code afterwards. Something like this:
{.emit: """#define b2Vec2 Vector2d_id
#include "<b2vec2.h>" """.}
You likely have to patch basic2d so that it produces a stable C type name. PRs will be accepted. Eventually the compiler will generate stable C name mangling, but for now you need to patch it with an .exportc annotation.