Added extern wrappers for C++, cleaned up gcc warnings