Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2461) bool type already exists
Home

[Freeciv-Dev] Re: (PR#2461) bool type already exists

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2461) bool type already exists
From: "Per I. Mathisen via RT" <rt@xxxxxxxxxxxxxx>
Date: Sun, 1 Dec 2002 04:56:43 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, 1 Dec 2002, Jason Short via RT wrote:
> Indicating that 'bool' was already defined in the system headers. It is
> typedefed as unsigned char.
>
> I see two choices:
>
> - Use fc_bool instead of bool.That way we don't interfere with anyone
> else.But people will forget to use it.  And IMO it is less readable.
>
> - Check for the 'bool' type in configure, and define HAVE_BOOL based on
> this.The downside here is that the check may not be trivial, since we
> don't know what header it might be in.

The solution to such problems is for configure to compile a very tiny
program that uses bool, and if this works, define HAVE_BOOL.

The bigger problem may be that bool is typedef'ed to char instead of int.
Wouldn't this cause some problems somewhere? Or at least lots of warnings?

  - Per




[Prev in Thread] Current Thread [Next in Thread]