On Sun, 3 Jun 2007, James Supancic wrote:
> I'm working on a C++ GUI for freeciv. I need to make some calls into
> the C component of client. The problem I'm running into is that the
> freeciv header files are neither standard C or C++ compatible.
> For example:
> typedef enum a b;
> enum a { A, B };
> When this is compiled with g++ or 'gcc -pedantic' there will be an
> error, if it is compiled with gcc there will be no error.
> Given this problem, I see three possible solutions:
> 1) Quit
> 2) update the freeciv headers
> 3) write a C++ compatible wrapper for the functions I need.
> #3 would be the easiest in the short term

I am sure #1 is easiest in the short term ;-)

More seriously - does it work if you compile with g++ using -fpermissive? 
If not, I'd say #2 is the best solution. But I would like to see a patch 
for some header files first, to see how invasive the required changes are.

> refactoring the code to eliminate the use of 'class' as an identifier 
> (as this is a C++ reserved keyword), perhaps other things.

C++ reserved keywords should be avoided, I agree.

   - Per

Freeciv-dev mailing list

Reply via email to