File tree 11 files changed +8
-160
lines changed
11 files changed +8
-160
lines changed Original file line number Diff line number Diff line change @@ -14958,47 +14958,6 @@ if test "$ac_cv_sizeof_off_t" -lt 8; then
14958
14958
fi
14959
14959
fi
14960
14960
14961
- # The cast to long int works around a bug in the HP C Compiler
14962
- # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14963
- # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14964
- # This bug is HP SR number 8606223364.
14965
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of bool" >&5
14966
- $as_echo_n "checking size of bool... " >&6; }
14967
- if ${ac_cv_sizeof_bool+:} false; then :
14968
- $as_echo_n "(cached) " >&6
14969
- else
14970
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "#include <stdbool.h>
14971
- "; then :
14972
-
14973
- else
14974
- if test "$ac_cv_type_bool" = yes; then
14975
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14976
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14977
- as_fn_error 77 "cannot compute sizeof (bool)
14978
- See \`config.log' for more details" "$LINENO" 5; }
14979
- else
14980
- ac_cv_sizeof_bool=0
14981
- fi
14982
- fi
14983
-
14984
- fi
14985
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_bool" >&5
14986
- $as_echo "$ac_cv_sizeof_bool" >&6; }
14987
-
14988
-
14989
-
14990
- cat >>confdefs.h <<_ACEOF
14991
- #define SIZEOF_BOOL $ac_cv_sizeof_bool
14992
- _ACEOF
14993
-
14994
-
14995
-
14996
- if test "$ac_cv_sizeof_bool" = 1; then
14997
-
14998
- $as_echo "#define PG_USE_STDBOOL 1" >>confdefs.h
14999
-
15000
- fi
15001
-
15002
14961
15003
14962
##
15004
14963
## Functions, global variables
Original file line number Diff line number Diff line change @@ -1691,15 +1691,6 @@ if test "$ac_cv_sizeof_off_t" -lt 8; then
1691
1691
fi
1692
1692
fi
1693
1693
1694
- AC_CHECK_SIZEOF ( [ bool] , [ ] , [ #include <stdbool.h>] )
1695
-
1696
- dnl We use <stdbool.h> if bool has size 1 after including it. Otherwise, c.h
1697
- dnl will fall back to declaring bool as unsigned char.
1698
- if test "$ac_cv_sizeof_bool" = 1; then
1699
- AC_DEFINE ( [ PG_USE_STDBOOL] , 1 ,
1700
- [ Define to 1 to use <stdbool.h> to define type bool.] )
1701
- fi
1702
-
1703
1694
1704
1695
# #
1705
1696
# # Functions, global variables
Original file line number Diff line number Diff line change @@ -1755,13 +1755,6 @@ if cc.compiles('''
1755
1755
endif
1756
1756
1757
1757
1758
- # We use <stdbool.h> if bool has size 1 after including it. Otherwise, c.h
1759
- # will fall back to declaring bool as unsigned char.
1760
- if cc.sizeof(' bool' , prefix : ' #include <stdbool.h>' , args : test_c_args) == 1
1761
- cdata.set(' PG_USE_STDBOOL' , 1 )
1762
- endif
1763
-
1764
-
1765
1758
# Need to check a call with %m because netbsd supports gnu_printf but emits a
1766
1759
# warning for each use of %m.
1767
1760
printf_attributes = [' gnu_printf' , ' __syslog__' , ' printf' ]
Original file line number Diff line number Diff line change @@ -117,11 +117,9 @@ ExecEvalBoolSubroutineTemplate(ExprState *state,
117
117
}
118
118
119
119
/*
120
- * Clang represents stdbool.h style booleans that are returned by functions
121
- * differently (as i1) than stored ones (as i8). Therefore we do not just need
122
- * TypeBool (above), but also a way to determine the width of a returned
123
- * integer. This allows us to keep compatible with non-stdbool using
124
- * architectures.
120
+ * Clang represents bool returned by functions differently (as i1) than stored
121
+ * ones (as i8). Therefore we do not just need TypeStorageBool (above), but
122
+ * also a way to determine the width of a returned integer.
125
123
*/
126
124
extern bool FunctionReturningBool (void );
127
125
bool
Original file line number Diff line number Diff line change 18
18
19
19
#ifndef WIN32
20
20
#include <dlfcn.h>
21
-
22
- /*
23
- * On macOS, <dlfcn.h> insists on including <stdbool.h>. If we're not
24
- * using stdbool, undef bool to undo the damage.
25
- */
26
- #ifndef PG_USE_STDBOOL
27
- #ifdef bool
28
- #undef bool
29
- #endif
30
- #endif
31
21
#endif /* !WIN32 */
32
22
33
23
#include "fmgr.h"
Original file line number Diff line number Diff line change @@ -450,37 +450,11 @@ typedef void (*pg_funcptr_t) (void);
450
450
* bool
451
451
* Boolean value, either true or false.
452
452
*
453
- * We use stdbool.h if bool has size 1 after including it. That's useful for
454
- * better compiler and debugger output and for compatibility with third-party
455
- * libraries. But PostgreSQL currently cannot deal with bool of other sizes;
456
- * there are static assertions around the code to prevent that.
457
- *
458
- * For C++ compilers, we assume the compiler has a compatible built-in
459
- * definition of bool.
460
- *
461
- * See also the version of this code in src/interfaces/ecpg/include/ecpglib.h.
453
+ * PostgreSQL currently cannot deal with bool of size other than 1; there are
454
+ * static assertions around the code to prevent that.
462
455
*/
463
456
464
- #ifndef __cplusplus
465
-
466
- #ifdef PG_USE_STDBOOL
467
457
#include <stdbool.h>
468
- #else
469
-
470
- #ifndef bool
471
- typedef unsigned char bool ;
472
- #endif
473
-
474
- #ifndef true
475
- #define true ((bool) 1)
476
- #endif
477
-
478
- #ifndef false
479
- #define false ((bool) 0)
480
- #endif
481
-
482
- #endif /* not PG_USE_STDBOOL */
483
- #endif /* not C++ */
484
458
485
459
486
460
/* ----------------------------------------------------------------
Original file line number Diff line number Diff line change 597
597
/* Define to best printf format archetype, usually gnu_printf if available. */
598
598
#undef PG_PRINTF_ATTRIBUTE
599
599
600
- /* Define to 1 to use <stdbool.h> to define type bool. */
601
- #undef PG_USE_STDBOOL
602
-
603
600
/* PostgreSQL version as a string */
604
601
#undef PG_VERSION
605
602
630
627
RELSEG_SIZE requires an initdb. */
631
628
#undef RELSEG_SIZE
632
629
633
- /* The size of `bool', as computed by sizeof. */
634
- #undef SIZEOF_BOOL
635
-
636
630
/* The size of `long', as computed by sizeof. */
637
631
#undef SIZEOF_LONG
638
632
Original file line number Diff line number Diff line change 6
6
7
7
/* Define to 1 if `long long int' works and is 64 bits. */
8
8
#undef HAVE_LONG_LONG_INT_64
9
-
10
- /* Define to 1 to use <stdbool.h> to define type bool. */
11
- #undef PG_USE_STDBOOL
Original file line number Diff line number Diff line change 7
7
#ifndef _ECPGLIB_H
8
8
#define _ECPGLIB_H
9
9
10
+ #include <stdbool.h>
10
11
#include <string.h>
11
12
12
13
#include "ecpg_config.h"
13
14
#include "ecpgtype.h"
14
15
#include "libpq-fe.h"
15
16
#include "sqlca.h"
16
17
17
- /*
18
- * This is a small extract from c.h since we don't want to leak all postgres
19
- * definitions into ecpg programs; but we need to know what bool is.
20
- */
21
- #ifndef __cplusplus
22
-
23
- #ifdef PG_USE_STDBOOL
24
- #include <stdbool.h>
25
- #else
26
-
27
- /*
28
- * We assume bool has been defined if true and false are. This avoids
29
- * duplicate-typedef errors if this file is included after c.h.
30
- */
31
- #if !(defined(true ) && defined(false ))
32
- typedef unsigned char bool ;
33
- #endif
34
-
35
- #ifndef true
36
- #define true ((bool) 1)
37
- #endif
38
-
39
- #ifndef false
40
- #define false ((bool) 0)
41
- #endif
42
-
43
- #endif /* not PG_USE_STDBOOL */
44
- #endif /* not C++ */
45
-
46
18
47
19
#ifdef __cplusplus
48
20
extern "C"
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ ecpg_inc = include_directories('.')
5
5
ecpg_conf_keys = [
6
6
' HAVE_LONG_INT_64' ,
7
7
' HAVE_LONG_LONG_INT_64' ,
8
- ' PG_USE_STDBOOL' ,
9
8
]
10
9
11
10
ecpg_conf_data = configuration_data ()
Original file line number Diff line number Diff line change 72
72
#endif
73
73
74
74
/*
75
- * Regarding bool, both PostgreSQL and Perl might use stdbool.h or not,
76
- * depending on configuration. If both agree, things are relatively harmless.
77
- * If not, things get tricky. If PostgreSQL does but Perl does not, define
78
- * HAS_BOOL here so that Perl does not redefine bool; this avoids compiler
79
- * warnings. If PostgreSQL does not but Perl does, we need to undefine bool
80
- * after we include the Perl headers; see below.
75
+ * Define HAS_BOOL here so that Perl does not redefine bool. We included
76
+ * <stdbool.h> in c.h.
81
77
*/
82
- #ifdef PG_USE_STDBOOL
83
78
#define HAS_BOOL 1
84
- #endif
85
79
86
80
/*
87
81
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code
180
174
/* perl version and platform portability */
181
175
#include "ppport.h"
182
176
183
- /*
184
- * perl might have included stdbool.h. If we also did that earlier (see c.h),
185
- * then that's fine. If not, we probably rejected it for some reason. In
186
- * that case, undef bool and proceed with our own bool. (Note that stdbool.h
187
- * makes bool a macro, but our own replacement is a typedef, so the undef
188
- * makes ours visible again).
189
- */
190
- #ifndef PG_USE_STDBOOL
191
- #ifdef bool
192
- #undef bool
193
- #endif
194
- #endif
195
-
196
177
/* supply HeUTF8 if it's missing - ppport.h doesn't supply it, unfortunately */
197
178
#ifndef HeUTF8
198
179
#define HeUTF8 (he ) ((HeKLEN(he) == HEf_SVKEY) ? \
You can’t perform that action at this time.
0 commit comments