added proper extern_c guards for c++ app linking