This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
bfd.h's true/false vs stdbool.h
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 3 Jan 2002 17:08:10 -0500
- Subject: bfd.h's true/false vs stdbool.h
As of (at least) recent 2.95 snapshots, GCC includes a standard header
<stdbool.h>. As of recent versions of ncurses (post-5.2), curses.h
includes this header if available. The definitions are compatible with the
ones chosen by BFD on my system, AFAICT (x86-linux):
/* The type `bool' must promote to `int' or `unsigned int'. The constants
`true' and `false' must have the value 0 and 1 respectively. */
typedef enum
{
false = 0,
true = 1
} bool;
/* The names `true' and `false' must also be made available as macros. */
#define false false
#define true true
/* Signal that all the definitions are present. */
#define __bool_true_false_are_defined 1
Should we autoconf for the presence of this header and use it?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer