Use a consistent definition of bool
Since _Bool is only ever a keyword and not a macro, and we can't test for HAVE_STDBOOL_H in the headers, remove the #ifdef for it in <cdio/types.h> and instead, simply define it as 'int'. Replace inclusion of <stdbool.h> with <cdio/types.h> so that a consistent definition of bool is used. Signed-off-by: Natalia Portillo <claunia@claunia.com>
This commit is contained in:
@@ -104,24 +104,15 @@ typedef uint8_t ubyte;
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
# if defined(HAVE_STDBOOL_H)
|
||||
# include <stdbool.h>
|
||||
# else
|
||||
/* ISO/IEC 9899:1999 <stdbool.h> missing -- enabling workaround */
|
||||
|
||||
/* All the stdbool.h seem to define those */
|
||||
#ifndef __bool_true_false_are_defined
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#undef bool
|
||||
#undef true
|
||||
#undef false
|
||||
|
||||
#ifdef _Bool
|
||||
#define bool _Bool
|
||||
#else
|
||||
#define bool int
|
||||
#endif
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#endif /* __bool_true_false_are_defined */
|
||||
# define false 0
|
||||
# define true 1
|
||||
# define bool uint8_t
|
||||
# endif /*HAVE_STDBOOL_H*/
|
||||
#endif /*C++*/
|
||||
|
||||
/* some GCC optimizations -- gcc 2.5+ */
|
||||
|
||||
@@ -25,11 +25,8 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <cdio/sector.h>
|
||||
#include <cdio/types.h>
|
||||
#include "cdio_assert.h"
|
||||
#include "cdio_private.h"
|
||||
|
||||
|
||||
@@ -24,13 +24,10 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/sector.h>
|
||||
#include <cdio/util.h>
|
||||
#include <cdio/types.h>
|
||||
#include <cdio/mmc.h>
|
||||
#include <cdio/logging.h>
|
||||
#include "cdio_assert.h"
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
@@ -31,6 +27,7 @@
|
||||
#include <cdio/logging.h>
|
||||
#include <cdio/sector.h>
|
||||
#include <cdio/util.h>
|
||||
#include <cdio/types.h>
|
||||
#include <cdio/mmc.h>
|
||||
#include "cdio_assert.h"
|
||||
#include "cdio_private.h"
|
||||
|
||||
@@ -45,12 +45,9 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <cdio/sector.h>
|
||||
#include <cdio/util.h>
|
||||
#include <cdio/types.h>
|
||||
#include "cdio_assert.h"
|
||||
#include "cdio_private.h"
|
||||
|
||||
|
||||
@@ -24,13 +24,10 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/sector.h>
|
||||
#include <cdio/util.h>
|
||||
#include <cdio/types.h>
|
||||
#include <cdio/mmc.h>
|
||||
#include <cdio/logging.h>
|
||||
#include "cdio_assert.h"
|
||||
|
||||
@@ -32,13 +32,10 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <cdio/logging.h>
|
||||
#include <cdio/sector.h>
|
||||
#include <cdio/util.h>
|
||||
#include <cdio/types.h>
|
||||
|
||||
/* For SCSI TR_* enumerations */
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user