made codegen compatible with visual studio C and C++ compilers