Be compatible with a C++ compiler

Fix errors when compiling with a C++ compiler.