Added generation of extern "C" for compatibility with C++