[SDL] C++ / SDL using bool vs. SDL_bool

John john at leafygreengames.com
Sat Mar 16 16:45:50 PDT 2013


C99 declares both bool and _Bool, plus a macro, __bool_true_false_are_defined.
The point of the macro is so you can fix these sort of custom boolean types in 
older code without breaking anything.



On 03/16/2013 05:47 PM, Sik the hedgehog wrote:
> I think C99's support for boolean values consists of stdbool.h and a
> _Bool type (*not* bool). Correct me if I'm wrong.
>
> 2013/3/16, Alex Barry <alex.barry at gmail.com>:
>> On Sat, Mar 16, 2013 at 4:52 PM, Steven Noonan
>> <steven at uplinklabs.net>wrote:
>>
>>> The 'bool' type was added in C99 (see section 7.16 in the C99 standard).
>>>
>>>
>> That's true, but I think Sam's logic is to support the lowest common
>> denominator - in this case, not every compiler will support a bool in
>> standard C, and it is typical for a C library to define a TRUE/FALSE value.
>>
>> I think typically, if a programmer is using SDL from C++, they would be
>> wrapping a lot of functions in C classes where SDL_Bool could be translated
>> into bool true/false values.
>>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



More information about the SDL mailing list