summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-02-01 19:50:45 -0700
committerKarl Williamson <khw@cpan.org>2022-02-06 12:16:54 -0700
commitb1c011dc3a1fd4662a219a9591314d12964a5d1b (patch)
tree30c8170a6e2352e011c75a3284db36e3732c0bc0
parent18cbf839872f70dd53e87fcb7f8a3be570a69669 (diff)
downloadperl-b1c011dc3a1fd4662a219a9591314d12964a5d1b.tar.gz
Remove PERL_BOOL_AS_CHAR uses; always define HAS_BOOL
Now that C99 is required, bool is always defined, so HAS_BOOL should also always be defined. PERL_BOOL_AS_CHAR was used to workaround problems when no bool type existed, so it is obsolete, and in fact perl won't compile if PERL_BOOL_AS_CHAR is #defined. So remove it completely from being looked at.
-rw-r--r--caretx.c6
-rw-r--r--handy.h29
-rw-r--r--os2/os2ish.h8
-rw-r--r--perl.c3
4 files changed, 2 insertions, 44 deletions
diff --git a/caretx.c b/caretx.c
index 7c155a6608..3d11877037 100644
--- a/caretx.c
+++ b/caretx.c
@@ -40,12 +40,6 @@
# include <mach-o/dyld.h>
#endif
-/* Note: Functions in this file must not have bool parameters. When
- PERL_BOOL_AS_CHAR is #defined, mach-o/dyld.h overrides it in this file
- by #including stdbool.h, so the function parameters here would conflict
- with those in proto.h.
-*/
-
void
Perl_set_caret_X(pTHX) {
GV* tmpgv = gv_fetchpvs("\030", GV_ADD|GV_NOTQUAL, SVt_PV); /* $^X */
diff --git a/handy.h b/handy.h
index a2dcb0daf6..8bbf9cbb34 100644
--- a/handy.h
+++ b/handy.h
@@ -106,36 +106,11 @@ already-built-in ones return pointers to what their names indicate.
#define MUTABLE_IO(p) ((IO *)MUTABLE_PTR(p))
#define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p))
-#if defined(I_STDBOOL) && !defined(PERL_BOOL_AS_CHAR)
+#ifndef __cplusplus
# include <stdbool.h>
-# ifndef HAS_BOOL
-# define HAS_BOOL 1
-# endif
-#endif
-
-/* bool is built-in for g++-2.6.3 and later, which might be used
- for extensions. <_G_config.h> defines _G_HAVE_BOOL, but we can't
- be sure _G_config.h will be included before this file. _G_config.h
- also defines _G_HAVE_BOOL for both gcc and g++, but only g++
- actually has bool. Hence, _G_HAVE_BOOL is pretty useless for us.
- g++ can be identified by __GNUG__.
- 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
-#ifndef HAS_BOOL
-# ifdef bool
-# undef bool
-# endif
-# define bool char
-# define HAS_BOOL 1
-#endif
+#define HAS_BOOL 1
/*
=for apidoc_section $casting
diff --git a/os2/os2ish.h b/os2/os2ish.h
index 1acc2765c2..0f80a4ddca 100644
--- a/os2/os2ish.h
+++ b/os2/os2ish.h
@@ -418,14 +418,6 @@ void *emx_realloc (void *, size_t);
#define PERLIO_IS_BINMODE_FD(fd) _PERLIO_IS_BINMODE_FD(fd)
-#ifdef __GNUG__
-# define HAS_BOOL
-#endif
-#ifndef HAS_BOOL
-# define bool char
-# define HAS_BOOL 1
-#endif
-
#include <emx/io.h> /* for _fd_flags() prototype */
static inline bool
diff --git a/perl.c b/perl.c
index 1edeb3548e..3f3cab15de 100644
--- a/perl.c
+++ b/perl.c
@@ -1906,9 +1906,6 @@ S_Internals_V(pTHX_ CV *cv)
# ifdef NO_TAINT_SUPPORT
" NO_TAINT_SUPPORT"
# endif
-# ifdef PERL_BOOL_AS_CHAR
- " PERL_BOOL_AS_CHAR"
-# endif
# ifdef PERL_COPY_ON_WRITE
" PERL_COPY_ON_WRITE"
# endif