summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-10-30 05:37:43 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-10-30 21:35:22 -0700
commitf789f6a4bdb5024b90845e6af62510d7f23eea5d (patch)
tree9e51aeeb7f8257fe1c923aeffb7094e952f63b83 /handy.h
parent7c688e65ecedd74107c7644e197efae4ca42ea0e (diff)
downloadperl-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.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index 131ede2e42..d345abe91f 100644
--- a/handy.h
+++ b/handy.h
@@ -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