use extern "C" for C++