If you are not using C99 and make sure you need to add your own boolean type, make sure you give it your name. Using "bool" or "BOOL" will cause trouble if you enable a third-party library. The one exception would be to use the de facto standard:
#define BOOL int
#define TRUE 1
#define FALSE 0
But pin them to #ifndef. But note that some libraries use 'char' as BOOL. If you come from the background of C ++, think about whether you want to interact with C ++.
Keith source
share