diff options
author | Alan Modra <amodra@gmail.com> | 2021-03-31 10:19:10 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-03-31 10:49:23 +1030 |
commit | ad9e24ad113a160d8d44dba0eb5cb02647a164e0 (patch) | |
tree | 3faaa1c83038a5d93208ed914fec2ef2ce933557 /bfd/bfd-in.h | |
parent | 3dfb1b6d34ec74160735230f606b1df55c917f9d (diff) | |
download | gdb-ad9e24ad113a160d8d44dba0eb5cb02647a164e0.zip gdb-ad9e24ad113a160d8d44dba0eb5cb02647a164e0.tar.gz gdb-ad9e24ad113a160d8d44dba0eb5cb02647a164e0.tar.bz2 |
Use stdbool.h
With this in place we can retire bfd_boolean one project at a time.
bfd/
* bfd-in.h: Include stdbool.h.
(bfd_boolean): Define as bool
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/bfd-in.h')
-rw-r--r-- | bfd/bfd-in.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 46a0fcd..88f1e86 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -35,6 +35,7 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" #include <stdint.h> +#include <stdbool.h> #include "diagnostics.h" #include <stdarg.h> #include <string.h> @@ -114,20 +115,19 @@ typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ typedef struct bfd bfd; -/* Boolean type used in bfd. Too many systems define their own - versions of "boolean" for us to safely typedef a "boolean" of - our own. Using an enum for "bfd_boolean" has its own set of - problems, with strange looking casts required to avoid warnings - on some older compilers. Thus we just use an int. - +/* Boolean type used in bfd. General rule: Functions which are bfd_boolean return TRUE on success and FALSE on failure (unless they're a predicate). */ -typedef int bfd_boolean; -#undef FALSE -#undef TRUE -#define FALSE 0 -#define TRUE 1 +#ifdef POISON_BFD_BOOLEAN +# pragma GCC poison bfd_boolean FALSE TRUE +#else +# define bfd_boolean bool +# undef FALSE +# undef TRUE +# define FALSE 0 +# define TRUE 1 +#endif #ifdef BFD64 |