develooper Front page | perl.perl5.porters | Postings from December 2016

Re: [perl #130393] h2xs: Support for _Bool/stdbool.h?

Thread Previous | Thread Next
Leon Timmermans
December 28, 2016 23:57
Re: [perl #130393] h2xs: Support for _Bool/stdbool.h?
Message ID:
On Fri, Dec 23, 2016 at 4:10 PM, Stefan Tauner <>

> _Bool is a C type introduced in C99, bool is a typedef declared by
> stdbool.h also from C99 and nothing fancy at all. I am using h2xs from
> ubuntu's Perl 5.22.1 but I could not find any hint on bool support in
> h2xs in Perl git thus I am reporting this here.

_Bool is indeed a C99 built-in type, but bool is a *macro* to _Bool, not a
typedef. This apparently confuses h2xs/C::Scan, which I don't think is
entirely unreasonable given the alternative.

I would recommend using _Bool instead of bool, that seems to generate
sensible XS if you add a one line typemap file to your distribution
_Bool   T_BOOL


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About