This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

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


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