bfd.h's true/false vs stdbool.h

Daniel Jacobowitz drow@mvista.com
Thu Jan 3 14:07:00 GMT 2002


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



More information about the Binutils mailing list