Tweaked to work with Swift projects.

Changed the C++ specific code to C code so that this project can be
used alongside Swift.