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.
This commit is contained in:
parent
3dfb1b6d34
commit
ad9e24ad11
@ -1,3 +1,9 @@
|
|||||||
|
2021-03-31 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* bfd-in.h: Include stdbool.h.
|
||||||
|
(bfd_boolean): Define as bool
|
||||||
|
* bfd-in2.h: Regenerate.
|
||||||
|
|
||||||
2021-03-31 Alan Modra <amodra@gmail.com>
|
2021-03-31 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* .gitignore: Delete bfd_stdint.h entry.
|
* .gitignore: Delete bfd_stdint.h entry.
|
||||||
|
14
bfd/bfd-in.h
14
bfd/bfd-in.h
@ -35,6 +35,7 @@ extern "C" {
|
|||||||
#include "ansidecl.h"
|
#include "ansidecl.h"
|
||||||
#include "symcat.h"
|
#include "symcat.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include "diagnostics.h"
|
#include "diagnostics.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -114,20 +115,19 @@ typedef BFD_HOSTPTR_T bfd_hostptr_t;
|
|||||||
/* Forward declaration. */
|
/* Forward declaration. */
|
||||||
typedef struct bfd bfd;
|
typedef struct bfd bfd;
|
||||||
|
|
||||||
/* Boolean type used in bfd. Too many systems define their own
|
/* Boolean type used in bfd.
|
||||||
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.
|
|
||||||
|
|
||||||
General rule: Functions which are bfd_boolean return TRUE on
|
General rule: Functions which are bfd_boolean return TRUE on
|
||||||
success and FALSE on failure (unless they're a predicate). */
|
success and FALSE on failure (unless they're a predicate). */
|
||||||
|
|
||||||
typedef int bfd_boolean;
|
#ifdef POISON_BFD_BOOLEAN
|
||||||
|
# pragma GCC poison bfd_boolean FALSE TRUE
|
||||||
|
#else
|
||||||
|
# define bfd_boolean bool
|
||||||
# undef FALSE
|
# undef FALSE
|
||||||
# undef TRUE
|
# undef TRUE
|
||||||
# define FALSE 0
|
# define FALSE 0
|
||||||
# define TRUE 1
|
# define TRUE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BFD64
|
#ifdef BFD64
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ extern "C" {
|
|||||||
#include "ansidecl.h"
|
#include "ansidecl.h"
|
||||||
#include "symcat.h"
|
#include "symcat.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include "diagnostics.h"
|
#include "diagnostics.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -121,20 +122,19 @@ typedef BFD_HOSTPTR_T bfd_hostptr_t;
|
|||||||
/* Forward declaration. */
|
/* Forward declaration. */
|
||||||
typedef struct bfd bfd;
|
typedef struct bfd bfd;
|
||||||
|
|
||||||
/* Boolean type used in bfd. Too many systems define their own
|
/* Boolean type used in bfd.
|
||||||
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.
|
|
||||||
|
|
||||||
General rule: Functions which are bfd_boolean return TRUE on
|
General rule: Functions which are bfd_boolean return TRUE on
|
||||||
success and FALSE on failure (unless they're a predicate). */
|
success and FALSE on failure (unless they're a predicate). */
|
||||||
|
|
||||||
typedef int bfd_boolean;
|
#ifdef POISON_BFD_BOOLEAN
|
||||||
|
# pragma GCC poison bfd_boolean FALSE TRUE
|
||||||
|
#else
|
||||||
|
# define bfd_boolean bool
|
||||||
# undef FALSE
|
# undef FALSE
|
||||||
# undef TRUE
|
# undef TRUE
|
||||||
# define FALSE 0
|
# define FALSE 0
|
||||||
# define TRUE 1
|
# define TRUE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BFD64
|
#ifdef BFD64
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user