various C++ fixes for macro compilation
enable macro compilation