This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Converting xconq to C++


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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]