From: Ralph Corderoy Date: Wed, 19 Oct 2016 16:52:44 +0000 (+0100) Subject: Add stdbool.h plus fallback to h/nmh.h. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/40009883832750cb536db4d41f500c0ad41005de?hp=ffdd694f6050652d492606e5adbcb5f491050ace Add stdbool.h plus fallback to h/nmh.h. Change h/mh.h's FALSE and TRUE to use stdbool.h's. In time, everything can switch over and FALSE and TRUE can go. Delete some local re-definitions of FALSE and TRUE. --- diff --git a/h/mh.h b/h/mh.h index d88df07f..513248cf 100644 --- a/h/mh.h +++ b/h/mh.h @@ -25,10 +25,10 @@ #define NMH_BUFSIZ (BUFSIZ>=8192 ? BUFSIZ : 8192) #ifndef FALSE -#define FALSE 0 +#define FALSE false #endif #ifndef TRUE -#define TRUE 1 +#define TRUE true #endif typedef unsigned char boolean; /* not int so we can pack in a structure */ diff --git a/h/nmh.h b/h/nmh.h index 24689192..ed02240a 100644 --- a/h/nmh.h +++ b/h/nmh.h @@ -15,6 +15,15 @@ # include #endif #include + +#ifdef HAVE_STDBOOL_H +# include +#else +# define bool int +# define true 1 +# define false 0 +#endif + #include #include diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 8d778e5e..26241ae1 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -40,9 +40,6 @@ */ #endif -#define TRUE 1 -#define FALSE 0 - #define NBITS ((sizeof (int)) * 8) /* diff --git a/sbr/getline.c b/sbr/getline.c index 7e3e7978..ab653bbe 100644 --- a/sbr/getline.c +++ b/sbr/getline.c @@ -10,13 +10,8 @@ #include #include #include -#ifdef HAVE_STDBOOL_H -# include -#else /* ! HAVE_STDBOOL_H */ -# define bool int -# define true 1 -# define false 0 -#endif /* ! HAVE_STDBOOL_H */ + +#include /* Largest possible size of buffer that allows SSIZE_MAX to be returned * to indicate SSIZE_MAX - 1 characters read before the '\n'. The diff --git a/uip/flist.c b/uip/flist.c index 6a10ad8a..68dd3f79 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -17,9 +17,6 @@ #include #include -#define FALSE 0 -#define TRUE 1 - /* * We allocate space to record the names of folders * (foldersToDo array), this number of elements at a time.