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

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

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
December 28, 2016 23:57
Subject:
Re: [perl #130393] h2xs: Support for _Bool/stdbool.h?
Message ID:
CAHhgV8gUp6eTScFas8vRwot2sMSMA3Mu=UV9p68bbEZTG7Crtw@mail.gmail.com
On Fri, Dec 23, 2016 at 4:10 PM, Stefan Tauner <perlbug-followup@perl.org>
wrote

> _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
containing
_Bool   T_BOOL

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About