Fix redefinition errors in C++ mode