astdbool.h does this:
# define bool _Bool # define false 0 # define true 1
This is not a good idea. It means using Allegro in C++ applications becomes hazardous to impossible, as it breaks overload resolution and template specialization involving bools; false and true are now ints rather than bools, which match differently (for instance, in MSVC9, the integer constant 0 matches pointers better [or at least as good as] than it matches bools, so a function overloaded on bool and char* will have the latter version chosen when you pass true or false to it).
Patch is simple; just wrap it in #ifndef __cplusplus so that these defines don't exist for C++ applications:
#ifndef __cplusplus # define bool _Bool # define false 0 # define true 1 #endif
There's also this comment above:
/* This code is recommended by the autoconf manual */
Which almost implies it's a very bad idea... 
And I wonder if we still support any compiler where stdbool.h doesn't exist anyway...
Well, as mentioned, on MSVC9 at least the aforementioned defines got defined (the reason I'm posting is of course because I got bit by this
), implying ALLEGRO_HAVE_STDBOOL_H was not defined...
And I wonder if we still support any compiler where stdbool.h doesn't exist anyway...
MSVC 9 doesn't have stdbool.h. It's a C99 header and MSVC is'nt a C99 compiler.
I've changed it to this, so astdbool.h does nothing in C++. I don't see any reason to define _Bool in C++.
#ifndef __cplusplus # ifdef ALLEGRO_HAVE_STDBOOL_H # include <stdbool.h> # else # ifndef ALLEGRO_HAVE__BOOL typedef unsigned char _Bool; # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 # endif #endif