summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/jit/llvm/llvmjit_types.c8
-rw-r--r--src/backend/utils/fmgr/dfmgr.c10
-rw-r--r--src/include/c.h30
-rw-r--r--src/include/pg_config.h.in6
-rw-r--r--src/interfaces/ecpg/include/ecpg_config.h.in3
-rw-r--r--src/interfaces/ecpg/include/ecpglib.h30
-rw-r--r--src/interfaces/ecpg/include/meson.build1
-rw-r--r--src/pl/plperl/plperl_system.h23
8 files changed, 8 insertions, 103 deletions
diff --git a/src/backend/jit/llvm/llvmjit_types.c b/src/backend/jit/llvm/llvmjit_types.c
index 4a9e0770145..13efe18e6b0 100644
--- a/src/backend/jit/llvm/llvmjit_types.c
+++ b/src/backend/jit/llvm/llvmjit_types.c
@@ -117,11 +117,9 @@ ExecEvalBoolSubroutineTemplate(ExprState *state,
}
/*
- * Clang represents stdbool.h style booleans that are returned by functions
- * differently (as i1) than stored ones (as i8). Therefore we do not just need
- * TypeBool (above), but also a way to determine the width of a returned
- * integer. This allows us to keep compatible with non-stdbool using
- * architectures.
+ * Clang represents bool returned by functions differently (as i1) than stored
+ * ones (as i8). Therefore we do not just need TypeStorageBool (above), but
+ * also a way to determine the width of a returned integer.
*/
extern bool FunctionReturningBool(void);
bool
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index c7aa789b51b..8e81ecc7491 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -18,16 +18,6 @@
#ifndef WIN32
#include <dlfcn.h>
-
-/*
- * On macOS, <dlfcn.h> insists on including <stdbool.h>. If we're not
- * using stdbool, undef bool to undo the damage.
- */
-#ifndef PG_USE_STDBOOL
-#ifdef bool
-#undef bool
-#endif
-#endif
#endif /* !WIN32 */
#include "fmgr.h"
diff --git a/src/include/c.h b/src/include/c.h
index fe1ce87882b..304dff27e34 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -450,37 +450,11 @@ typedef void (*pg_funcptr_t) (void);
* bool
* Boolean value, either true or false.
*
- * We use stdbool.h if bool has size 1 after including it. That's useful for
- * better compiler and debugger output and for compatibility with third-party
- * libraries. But PostgreSQL currently cannot deal with bool of other sizes;
- * there are static assertions around the code to prevent that.
- *
- * For C++ compilers, we assume the compiler has a compatible built-in
- * definition of bool.
- *
- * See also the version of this code in src/interfaces/ecpg/include/ecpglib.h.
+ * PostgreSQL currently cannot deal with bool of size other than 1; there are
+ * static assertions around the code to prevent that.
*/
-#ifndef __cplusplus
-
-#ifdef PG_USE_STDBOOL
#include <stdbool.h>
-#else
-
-#ifndef bool
-typedef unsigned char bool;
-#endif
-
-#ifndef true
-#define true ((bool) 1)
-#endif
-
-#ifndef false
-#define false ((bool) 0)
-#endif
-
-#endif /* not PG_USE_STDBOOL */
-#endif /* not C++ */
/* ----------------------------------------------------------------
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 6e25afc58fd..ab0f8cc2b4a 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -597,9 +597,6 @@
/* Define to best printf format archetype, usually gnu_printf if available. */
#undef PG_PRINTF_ATTRIBUTE
-/* Define to 1 to use <stdbool.h> to define type bool. */
-#undef PG_USE_STDBOOL
-
/* PostgreSQL version as a string */
#undef PG_VERSION
@@ -630,9 +627,6 @@
RELSEG_SIZE requires an initdb. */
#undef RELSEG_SIZE
-/* The size of `bool', as computed by sizeof. */
-#undef SIZEOF_BOOL
-
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
diff --git a/src/interfaces/ecpg/include/ecpg_config.h.in b/src/interfaces/ecpg/include/ecpg_config.h.in
index 2b439c1e58d..75f542f263b 100644
--- a/src/interfaces/ecpg/include/ecpg_config.h.in
+++ b/src/interfaces/ecpg/include/ecpg_config.h.in
@@ -6,6 +6,3 @@
/* Define to 1 if `long long int' works and is 64 bits. */
#undef HAVE_LONG_LONG_INT_64
-
-/* Define to 1 to use <stdbool.h> to define type bool. */
-#undef PG_USE_STDBOOL
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index 771761ffe49..dbf3cc3a0c2 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -7,6 +7,7 @@
#ifndef _ECPGLIB_H
#define _ECPGLIB_H
+#include <stdbool.h>
#include <string.h>
#include "ecpg_config.h"
@@ -14,35 +15,6 @@
#include "libpq-fe.h"
#include "sqlca.h"
-/*
- * This is a small extract from c.h since we don't want to leak all postgres
- * definitions into ecpg programs; but we need to know what bool is.
- */
-#ifndef __cplusplus
-
-#ifdef PG_USE_STDBOOL
-#include <stdbool.h>
-#else
-
-/*
- * We assume bool has been defined if true and false are. This avoids
- * duplicate-typedef errors if this file is included after c.h.
- */
-#if !(defined(true) && defined(false))
-typedef unsigned char bool;
-#endif
-
-#ifndef true
-#define true ((bool) 1)
-#endif
-
-#ifndef false
-#define false ((bool) 0)
-#endif
-
-#endif /* not PG_USE_STDBOOL */
-#endif /* not C++ */
-
#ifdef __cplusplus
extern "C"
diff --git a/src/interfaces/ecpg/include/meson.build b/src/interfaces/ecpg/include/meson.build
index b4a5aedd51f..a3beb3cc7be 100644
--- a/src/interfaces/ecpg/include/meson.build
+++ b/src/interfaces/ecpg/include/meson.build
@@ -5,7 +5,6 @@ ecpg_inc = include_directories('.')
ecpg_conf_keys = [
'HAVE_LONG_INT_64',
'HAVE_LONG_LONG_INT_64',
- 'PG_USE_STDBOOL',
]
ecpg_conf_data = configuration_data()
diff --git a/src/pl/plperl/plperl_system.h b/src/pl/plperl/plperl_system.h
index 48f6575e513..d1b9ea17fca 100644
--- a/src/pl/plperl/plperl_system.h
+++ b/src/pl/plperl/plperl_system.h
@@ -72,16 +72,10 @@
#endif
/*
- * Regarding bool, both PostgreSQL and Perl might use stdbool.h or not,
- * depending on configuration. If both agree, things are relatively harmless.
- * If not, things get tricky. If PostgreSQL does but Perl does not, define
- * HAS_BOOL here so that Perl does not redefine bool; this avoids compiler
- * warnings. If PostgreSQL does not but Perl does, we need to undefine bool
- * after we include the Perl headers; see below.
+ * Define HAS_BOOL here so that Perl does not redefine bool. We included
+ * <stdbool.h> in c.h.
*/
-#ifdef PG_USE_STDBOOL
#define HAS_BOOL 1
-#endif
/*
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code
@@ -180,19 +174,6 @@
/* perl version and platform portability */
#include "ppport.h"
-/*
- * perl might have included stdbool.h. If we also did that earlier (see c.h),
- * then that's fine. If not, we probably rejected it for some reason. In
- * that case, undef bool and proceed with our own bool. (Note that stdbool.h
- * makes bool a macro, but our own replacement is a typedef, so the undef
- * makes ours visible again).
- */
-#ifndef PG_USE_STDBOOL
-#ifdef bool
-#undef bool
-#endif
-#endif
-
/* supply HeUTF8 if it's missing - ppport.h doesn't supply it, unfortunately */
#ifndef HeUTF8
#define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \