comparison 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
comparison
equal deleted inserted replaced
734:2ae1045f6c18 735:31bc1ed07cf5
177 #endif 177 #endif
178 178
179 179
180 /* Define a boolean type, if needed 180 /* Define a boolean type, if needed
181 */ 181 */
182 #if !defined(FALSE) && !defined(TRUE) && !defined(BOOL) 182 #if defined(HAVE_STDBOOL_H)
183 typedef enum { FALSE = 0, TRUE = 1 } BOOL; 183 # include <stdbool.h>
184 #endif 184 #elif !defined(false) && !defined(true) && !defined(bool)
185 185 typedef enum { false = 0, true = 1 } bool;
186 #ifndef BOOL 186 #else
187 # ifdef bool 187 # error Missing boolean definition and could not define our own.
188 # define BOOL bool
189 # else
190 # define BOOL int
191 # endif
192 #endif 188 #endif
193 189
194 190
195 /** @brief th_char_t 191 /** @brief th_char_t
196 * Character type. Currently it is not recommended to re-define this, 192 * Character type. Currently it is not recommended to re-define this,