Fix #1782

Must use extern "C" otherwise C functions are not linked with the build when called from Objective C++ (.mm) files