Removing const qual required to work around bug 14445
Refactoring C calls from XC to use extern "C"