On Tue, Sep 22, 2009 at 12:54 PM, Joel Sherrill
<joel.sherr...@oarcorp.com> wrote:
> Florian Weimer wrote:
>>
>> * Joel Sherrill:
>>
>>
>>>
>>> What is the proper type to use in an Ada binding
>>> for a C method that returns a C99 bool?
>>>
>>
>> Whatever the answer is, it should be used to define Interfaces.C.Bool.
>> (I don't know what GCC's options for representing _Bool are, sorry.)
>>
>>
>
> It appears to be unsigned char or at least sizeof(bool)=1
> on the architectures I tried this test program on.
>
> #include <stdbool.h>
>
> bool x;
> int s = sizeof(bool);
>
> Unfortunately bool is defined to _Bool and that must be
> something gcc recognizes.  I don't see it in .h files.

C99 Boolean type is _Bool.  C99 requires people to
include <stdbool> if they want to write bool instead of _Bool.

>
> --joel
>

Reply via email to