declare extern "C" for c++ compilers - Thanks fps!