Minor additions

Added some minor additions to compile with gcc and to use it with C++
(avoid name mangling)