Add C++ support by forcing functions to have C linkage