Mercurial > hg > th-libs
diff th_types.h @ 735:31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Dec 2022 12:14:39 +0200 |
parents | 29e44a58bc73 |
children | a557d1b2a356 |
line wrap: on
line diff
--- a/th_types.h Wed Dec 07 11:58:54 2022 +0200 +++ b/th_types.h Wed Dec 07 12:14:39 2022 +0200 @@ -179,16 +179,12 @@ /* Define a boolean type, if needed */ -#if !defined(FALSE) && !defined(TRUE) && !defined(BOOL) -typedef enum { FALSE = 0, TRUE = 1 } BOOL; -#endif - -#ifndef BOOL -# ifdef bool -# define BOOL bool -# else -# define BOOL int -# endif +#if defined(HAVE_STDBOOL_H) +# include <stdbool.h> +#elif !defined(false) && !defined(true) && !defined(bool) +typedef enum { false = 0, true = 1 } bool; +#else +# error Missing boolean definition and could not define our own. #endif