Converting xconq to C++
Erik Sigra
sigra@home.se
Fri Mar 29 04:15:00 GMT 2002
This has been done to Freeciv a while ago. The approach was this:
* Change all identifiers that are reserved words in C++ but not in C (and,
and_eq, asm, bitand, bitor, catch, class, compl, const_cast, delete,
dynamic_cast, friend, inline, new, not, not_eq, operator, or, or_eq,
private, protected, public, reinterpret_cast, static_cast, template, this,
throw, try, typeid, virtual, xor, xor_eq, ...).
* Add casts that both C and C++ accepts to allocations ("malloc(...)" to
"(material *) malloc(...)").
* Introduce the type "bool" (and of course make sure there are no identifiers
called bool, true or false).
* Compile with g++ instead of gcc and see what else it complains about.
Then the code will be both C and C++, the common subset. Although I prefer
Ada...
More information about the Xconq7
mailing list