diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-10-30 05:37:43 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-10-30 21:35:22 -0700 |
commit | f789f6a4bdb5024b90845e6af62510d7f23eea5d (patch) | |
tree | 9e51aeeb7f8257fe1c923aeffb7094e952f63b83 /handy.h | |
parent | 7c688e65ecedd74107c7644e197efae4ca42ea0e (diff) | |
download | perl-f789f6a4bdb5024b90845e6af62510d7f23eea5d.tar.gz |
Introduce PERL_BOOL_AS_CHAR define
This allows compilers that do support real booleans (C++ or anything
with stdbool.h) to emulate those that don’t.
See ticket #120314.
This patch incorporates suggestions from Craig Berry.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -69,7 +69,7 @@ Null SV pointer. (No longer available when C<PERL_CORE> is defined.) #define MUTABLE_IO(p) ((IO *)MUTABLE_PTR(p)) #define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p)) -#ifdef I_STDBOOL +#if defined(I_STDBOOL) && !defined(PERL_BOOL_AS_CHAR) # include <stdbool.h> # ifndef HAS_BOOL # define HAS_BOOL 1 @@ -85,9 +85,11 @@ Null SV pointer. (No longer available when C<PERL_CORE> is defined.) Andy Dougherty February 2000 */ #ifdef __GNUG__ /* GNU g++ has bool built-in */ +# ifndef PERL_BOOL_AS_CHAR # ifndef HAS_BOOL # define HAS_BOOL 1 # endif +# endif #endif /* The NeXT dynamic loader headers will not build with the bool macro @@ -104,6 +106,9 @@ Null SV pointer. (No longer available when C<PERL_CORE> is defined.) #endif /* NeXT || __NeXT__ */ #ifndef HAS_BOOL +# ifdef bool +# undef bool +# endif # define bool char # define HAS_BOOL 1 #endif |