more extern "C" fixes, not sure if they work on gcc!