Needs 'extern "C"' for calling from C++