From 93db2fd36ca36d7edb64463100d1c53566025ce7 Mon Sep 17 00:00:00 2001 From: Mark Grondona <mgrondona@llnl.gov> Date: Wed, 26 Jun 2002 21:11:06 +0000 Subject: [PATCH] o include and use stdbool.h if available, otherwise define a bool type. (macros.h) o Include macros.h in slurm_protocol_defs.h --- src/common/macros.h | 10 ++++++++-- src/common/slurm_protocol_defs.h | 4 +--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common/macros.h b/src/common/macros.h index 13ec4411c0a..49cab1553a2 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -13,12 +13,18 @@ # include <stddef.h> /* for NULL */ #endif +#if HAVE_STDBOOL_H +# include <stdbool.h> +#else +typedef enum {false, true} bool; +#endif /* !HAVE_STDBOOL_H */ + #ifndef FALSE -#define FALSE (0) +#define FALSE false #endif #ifndef TRUE -#define TRUE (!FALSE) +#define TRUE true #endif /* diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index 1ab0dce145a..6557c37b72c 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -14,11 +14,9 @@ # include <inttypes.h> #endif /* HAVE_CONFIG_H */ -/* true, false */ -#define true -1 -#define false 0 #define NO_VAL 0x7f7f7f7f +#include <src/common/macros.h> #include <src/common/slurm_protocol_common.h> /* SLURM Message types */ -- GitLab