configmgr/source/access.cxx | 7 connectivity/source/manager/mdrivermanager.cxx | 4 external/postgresql/0001-Assume-that-stdbool.h-conforms-to-the-C-standard.patch.1 | 397 ++++++++++ external/postgresql/UnpackedTarball_postgresql.mk | 1 vcl/source/window/layout.cxx | 12 5 files changed, 413 insertions(+), 8 deletions(-)
New commits: commit b28dd875dde2b7cf920d09b795a5ab485cd31a12 Author: Stephan Bergmann <[email protected]> AuthorDate: Wed Sep 11 20:22:25 2024 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Thu Oct 2 16:33:15 2025 +0200 These bogus -Wdangling-reference still hit with current GCC 15 trunk Change-Id: Ice2be2156474cf486ad1c461d65e2711ebf43d2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173232 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit 294b4cc5458b9e20da98d12405a5942ae1551aee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191781 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index d301b2c4841b..106da47b661a 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -601,12 +601,12 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const OUString& _rU m_aDriversBS.end(), // end of search range [&_rURL, this] (const DriverAccessArray::value_type& driverAccess) { // extract the driver from the access, then ask the resulting driver for acceptance -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-reference" #endif const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess); -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic pop #endif const Reference<XDriver> driver = ExtractDriverFromAccess()(ensuredAccess); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index ec4331528f9a..9703ca3745cc 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -954,12 +954,12 @@ array_type assembleGrid(const VclGrid &rGrid) { for (sal_Int32 y = 0; y < nMaxY; ++y) { -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-reference" #endif const GridEntry &rEntry = A[x][y]; -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic pop #endif const vcl::Window *pChild = rEntry.pChild; @@ -1084,12 +1084,12 @@ static void calcMaxs(const array_type &A, std::vector<VclGrid::Value> &rWidths, { for (sal_Int32 y = 0; y < nMaxY; ++y) { -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-reference" #endif const GridEntry &rEntry = A[x][y]; -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic pop #endif const vcl::Window *pChild = rEntry.pChild; @@ -1122,12 +1122,12 @@ static void calcMaxs(const array_type &A, std::vector<VclGrid::Value> &rWidths, { for (sal_Int32 y = 0; y < nMaxY; ++y) { -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-reference" #endif const GridEntry &rEntry = A[x][y]; -#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 15 #pragma GCC diagnostic pop #endif const vcl::Window *pChild = rEntry.pChild; commit 771641c861ef7f19092d1eea7cfce447f6cd880d Author: Stephan Bergmann <[email protected]> AuthorDate: Thu Jul 24 08:23:09 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Thu Oct 2 16:33:09 2025 +0200 Silence bogus GCC -Wstringop-overflow ...seen at least with gcc-15.1.1-2.fc42.x86_64, when doing optimizing LO builds, > In file included from include/rtl/ustring.h:29, > from include/typelib/typedescription.h:29, > from include/com/sun/star/uno/Type.h:26, > from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/beans/Property.hdl:6, > from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/beans/Property.hpp:6, > from configmgr/source/access.cxx:28: > In member function ‘void configmgr::Access::releaseNondeleting()’, > inlined from ‘rtl::Reference<configmgr::ChildAccess> configmgr::Access::getUnmodifiedChild(const rtl::OUString&)’ at configmgr/source/access.cxx:2064:38: > include/osl/interlck.h:91:57: error: ‘unsigned int __sync_sub_and_fetch_4(volatile void*, unsigned int)’ writing 4 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] > 91 | # define osl_atomic_decrement(p) __sync_sub_and_fetch((p), 1) > | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~ > configmgr/source/access.cxx:134:5: note: in expansion of macro ‘osl_atomic_decrement’ > 134 | osl_atomic_decrement(&m_refCount); > | ^~~~~~~~~~~~~~~~~~~~ > In member function ‘rtl::Reference<configmgr::ChildAccess> configmgr::Access::getUnmodifiedChild(const rtl::OUString&)’: > cc1plus: note: destination object is likely at address zero Change-Id: I0885af282844fecaf4c117df7d24a943b62aa42c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188259 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit 33bb647987f955412c0f1e4aae2e10cc4e91391d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189335 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 3fc7df809ed660e695bb0b095c23184f2989bb8d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191780 diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 1e2d73dafe9c..c4d8819bd351 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -129,7 +129,14 @@ oslInterlockedCount Access::acquireCounting() { } void Access::releaseNondeleting() { +#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 15 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif osl_atomic_decrement(&m_refCount); +#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 15 +#pragma GCC diagnostic pop +#endif } bool Access::isValue() { commit 330310788014b894b4e78c66e7fe4c4974437b81 Author: Stephan Bergmann <[email protected]> AuthorDate: Mon Nov 25 18:12:39 2024 +0100 Commit: Michael Stahl <[email protected]> CommitDate: Thu Oct 2 16:33:02 2025 +0200 external/postgresql: Include configure fix for C23 stdbool.h ...by backporting upstream <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=bc5a4dfcf7390145dc3ba3c1c18c5ce561b778cd> "Assume that <stdbool.h> conforms to the C standard." to our REL_14_15 version. GCC 15 trunk defaults to C23 now, so started to fail with > In file included from fls.c:49: > ../../src/include/c.h:419:23: error: two or more data types in declaration specifiers > 419 | typedef unsigned char bool; > | ^~~~ > ../../src/include/c.h:419:1: warning: useless type name in empty declaration > 419 | typedef unsigned char bool; > | ^~~~~~~ > make: *** [<builtin>: fls.o] Error 1 > make: Leaving directory 'workdir/UnpackedTarball/postgresql/src/port' (Removing HAVE__BOOL and HAVE_STDBOOL_H also from src/tools/msvc/Solution.pm is necessary to avoid failures like > "C:/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/workdir/UnpackedTarball/opensslpps\openssl.exe" version 2>&1unused defines: HAVE_STDBOOL_H HAVE__BOOL at /home/tdf/jenkins/workspace/gerrit_windows/workdir/UnpackedTarball/postgresql/src/tools/msvc/Mkvcbuild.pm line 870. > make[1]: *** [C:/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/external/postgresql/ExternalProject_postgresql.mk:27: C:/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/workdir/ExternalProject/postgresql/build] Error 1 in MSVC builds.) Change-Id: I1f6bd0d613ae4d6ce70feaaf67aaf95496eeff87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177280 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins (cherry picked from commit ea0b06415b35ff68959c8fb24355f2c15ad63e64) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191779 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/external/postgresql/0001-Assume-that-stdbool.h-conforms-to-the-C-standard.patch.1 b/external/postgresql/0001-Assume-that-stdbool.h-conforms-to-the-C-standard.patch.1 new file mode 100644 index 000000000000..669b9a567d2f --- /dev/null +++ b/external/postgresql/0001-Assume-that-stdbool.h-conforms-to-the-C-standard.patch.1 @@ -0,0 +1,397 @@ +From d5fb5a35816df670d329600e44fe22617b578415 Mon Sep 17 00:00:00 2001 +From: Thomas Munro <[email protected]> +Date: Mon, 25 Nov 2024 13:11:28 +1300 +Subject: Assume that <stdbool.h> conforms to the C standard. + +Previously we checked "for <stdbool.h> that conforms to C99" using +autoconf's AC_HEADER_STDBOOL macro. We've required C99 since PostgreSQL +12, so the test was redundant, and under C23 it was broken: autoconf +2.69's implementation doesn't understand C23's new empty header (the +macros it's looking for went away, replaced by language keywords). +Later autoconf versions fixed that, but let's just remove the +anachronistic test. + +HAVE_STDBOOL_H and HAVE__BOOL will no longer be defined, but they +weren't directly tested in core or likely extensions (except in 11, see +below). PG_USE_STDBOOL (or USE_STDBOOL in 11 and 12) is still defined +when sizeof(bool) is 1, which should be true on all modern systems. +Otherwise we define our own bool type and values of size 1, which would +fail to compile under C23 as revealed by the broken test. (We'll +probably clean that dead code up in master, but here we want a minimal +back-patchable change.) + +This came to our attention when GCC 15 recently started using using C23 +by default and failed to compile the replacement code, as reported by +Sam James and build farm animal alligator. + +Back-patch to all supported releases, and then two older versions that +also know about <stdbool.h>, per the recently-out-of-support policy[1]. +12 requires C99 so it's much like the supported releases, but 11 only +assumes C89 so it now uses AC_CHECK_HEADERS instead of the overly picky +AC_HEADER_STDBOOL. (I could find no discussion of which historical +systems had <stdbool.h> but failed the conformance test; if they ever +existed, they surely aren't relevant to that policy's goals.) + +[1] https://wiki.postgresql.org/wiki/Committing_checklist#Policies + +Reported-by: Sam James <[email protected]> +Reviewed-by: Peter Eisentraut <[email protected]> (master version) +Reviewed-by: Tom Lane <[email protected]> (approach) +Discussion: https://www.postgresql.org/message-id/flat/87o72eo9iu.fsf%40gentoo.org +(cherry picked from commit bc5a4dfcf7390145dc3ba3c1c18c5ce561b778cd) +Conflicts: + configure + meson.build + src/include/pg_config.h.in + src/tools/msvc/Solution.pm +--- + configure | 182 +++++++++---------------------------- + configure.ac | 13 +-- + src/include/c.h | 2 +- + src/include/pg_config.h.in | 6 -- + src/tools/msvc/Solution.pm | 2 - + 5 files changed, 48 insertions(+), 157 deletions(-) + +diff --git a/configure b/configure +index 7e6030e9e1..7a5bdeddbd 100755 +--- a/configure ++++ b/configure +@@ -2085,116 +2085,116 @@ $as_echo "$ac_res" >&6; } + + } # ac_fn_c_check_func + +-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +-# ------------------------------------------- +-# Tests whether TYPE exists after having included INCLUDES, setting cache +-# variable VAR accordingly. +-ac_fn_c_check_type () ++# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES ++# ---------------------------------------------------- ++# Tries to find if the field MEMBER exists in type AGGR, after including ++# INCLUDES, setting cache variable VAR accordingly. ++ac_fn_c_check_member () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +-$as_echo_n "checking for $2... " >&6; } +-if eval \${$3+:} false; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 ++$as_echo_n "checking for $2.$3... " >&6; } ++if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 + else +- eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-$4 ++$5 + int + main () + { +-if (sizeof ($2)) +- return 0; ++static $2 ac_aggr; ++if (ac_aggr.$3) ++return 0; + ; + return 0; + } + _ACEOF + if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$4=yes" ++else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-$4 ++$5 + int + main () + { +-if (sizeof (($2))) +- return 0; ++static $2 ac_aggr; ++if (sizeof ac_aggr.$3) ++return 0; + ; + return 0; + } + _ACEOF + if ac_fn_c_try_compile "$LINENO"; then : +- ++ eval "$4=yes" + else +- eval "$3=yes" ++ eval "$4=no" + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +-eval ac_res=\$$3 ++eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 + $as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +-} # ac_fn_c_check_type ++} # ac_fn_c_check_member + +-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +-# ---------------------------------------------------- +-# Tries to find if the field MEMBER exists in type AGGR, after including +-# INCLUDES, setting cache variable VAR accordingly. +-ac_fn_c_check_member () ++# ac_fn_c_check_type LINENO TYPE VAR INCLUDES ++# ------------------------------------------- ++# Tests whether TYPE exists after having included INCLUDES, setting cache ++# variable VAR accordingly. ++ac_fn_c_check_type () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +-$as_echo_n "checking for $2.$3... " >&6; } +-if eval \${$4+:} false; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 + else ++ eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-$5 ++$4 + int + main () + { +-static $2 ac_aggr; +-if (ac_aggr.$3) +-return 0; ++if (sizeof ($2)) ++ return 0; + ; + return 0; + } + _ACEOF + if ac_fn_c_try_compile "$LINENO"; then : +- eval "$4=yes" +-else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-$5 ++$4 + int + main () + { +-static $2 ac_aggr; +-if (sizeof ac_aggr.$3) +-return 0; ++if (sizeof (($2))) ++ return 0; + ; + return 0; + } + _ACEOF + if ac_fn_c_try_compile "$LINENO"; then : +- eval "$4=yes" ++ + else +- eval "$4=no" ++ eval "$3=yes" + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +-eval ac_res=\$$4 ++eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 + $as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +-} # ac_fn_c_check_member ++} # ac_fn_c_check_type + + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES + # -------------------------------------------- +@@ -13746,100 +13746,6 @@ fi + ## Header files + ## + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +-if ${ac_cv_header_stdbool_h+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +- #include <stdbool.h> +- #ifndef bool +- "error: bool is not defined" +- #endif +- #ifndef false +- "error: false is not defined" +- #endif +- #if false +- "error: false is not 0" +- #endif +- #ifndef true +- "error: true is not defined" +- #endif +- #if true != 1 +- "error: true is not 1" +- #endif +- #ifndef __bool_true_false_are_defined +- "error: __bool_true_false_are_defined is not defined" +- #endif +- +- struct s { _Bool s: 1; _Bool t; } s; +- +- char a[true == 1 ? 1 : -1]; +- char b[false == 0 ? 1 : -1]; +- char c[__bool_true_false_are_defined == 1 ? 1 : -1]; +- char d[(bool) 0.5 == true ? 1 : -1]; +- /* See body of main program for 'e'. */ +- char f[(_Bool) 0.0 == false ? 1 : -1]; +- char g[true]; +- char h[sizeof (_Bool)]; +- char i[sizeof s.t]; +- enum { j = false, k = true, l = false * true, m = true * 256 }; +- /* The following fails for +- HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ +- _Bool n[m]; +- char o[sizeof n == m * sizeof n[0] ? 1 : -1]; +- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +- /* Catch a bug in an HP-UX C compiler. See +- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html +- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html +- */ +- _Bool q = true; +- _Bool *pq = &q; +- +-int +-main () +-{ +- +- bool e = &s; +- *pq |= q; +- *pq |= ! q; +- /* Refer to every declared value, to avoid compiler optimizations. */ +- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l +- + !m + !n + !o + !p + !q + !pq); +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : +- ac_cv_header_stdbool_h=yes +-else +- ac_cv_header_stdbool_h=no +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +-$as_echo "$ac_cv_header_stdbool_h" >&6; } +- ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +-if test "x$ac_cv_type__Bool" = xyes; then : +- +-cat >>confdefs.h <<_ACEOF +-#define HAVE__BOOL 1 +-_ACEOF +- +- +-fi +- +- +-if test $ac_cv_header_stdbool_h = yes; then +- +-$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h +- +-fi +- +- + for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h wctype.h + do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +@@ -15711,9 +15617,7 @@ $as_echo_n "checking size of bool... " >&6; } + if ${ac_cv_sizeof_bool+:} false; then : + $as_echo_n "(cached) " >&6 + else +- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "#ifdef HAVE_STDBOOL_H +-#include <stdbool.h> +-#endif ++ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "#include <stdbool.h> + "; then : + + else +@@ -15739,7 +15643,7 @@ _ACEOF + + + +-if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then ++if test "$ac_cv_sizeof_bool" = 1; then + + $as_echo "#define PG_USE_STDBOOL 1" >>confdefs.h + +diff --git a/src/include/c.h b/src/include/c.h +index dd2e3b0f3e..cc19c23fb6 100644 +--- a/src/include/c.h ++++ b/src/include/c.h +@@ -398,7 +398,7 @@ typedef void (*pg_funcptr_t) (void); + * bool + * Boolean value, either true or false. + * +- * We use stdbool.h if available and its bool has size 1. That's useful for ++ * 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. +diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in +index 99e3731813..d9ef9a41bf 100644 +--- a/src/include/pg_config.h.in ++++ b/src/include/pg_config.h.in +@@ -517,9 +517,6 @@ + /* Define to 1 if you have the `SSL_CTX_set_num_tickets' function. */ + #undef HAVE_SSL_CTX_SET_NUM_TICKETS + +-/* Define to 1 if stdbool.h conforms to C99. */ +-#undef HAVE_STDBOOL_H +- + /* Define to 1 if you have the <stdint.h> header file. */ + #undef HAVE_STDINT_H + +@@ -730,9 +727,6 @@ + /* Define to 1 if the assembler supports X86_64's POPCNTQ instruction. */ + #undef HAVE_X86_64_POPCNTQ + +-/* Define to 1 if the system has the type `_Bool'. */ +-#undef HAVE__BOOL +- + /* Define to 1 if your compiler understands __builtin_bswap16. */ + #undef HAVE__BUILTIN_BSWAP16 + +diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm +index 07cc7b7ba2..f0ce2ac804 100644 +--- a/src/tools/msvc/Solution.pm ++++ b/src/tools/msvc/Solution.pm +@@ -365,7 +365,6 @@ sub GenerateFiles + HAVE_SPINLOCKS => 1, + HAVE_SSL_CTX_SET_NUM_TICKETS => undef, + HAVE_SRANDOM => undef, +- HAVE_STDBOOL_H => 1, + HAVE_STDINT_H => 1, + HAVE_STDLIB_H => 1, + HAVE_STRCHRNUL => undef, +@@ -436,7 +435,6 @@ sub GenerateFiles + HAVE_X509_GET_SIGNATURE_NID => 1, + HAVE_X509_GET_SIGNATURE_INFO => undef, + HAVE_X86_64_POPCNTQ => undef, +- HAVE__BOOL => undef, + HAVE__BUILTIN_BSWAP16 => undef, + HAVE__BUILTIN_BSWAP32 => undef, + HAVE__BUILTIN_BSWAP64 => undef, +-- +2.47.0 + diff --git a/external/postgresql/UnpackedTarball_postgresql.mk b/external/postgresql/UnpackedTarball_postgresql.mk index 11fb603ef34f..44528b78d26f 100644 --- a/external/postgresql/UnpackedTarball_postgresql.mk +++ b/external/postgresql/UnpackedTarball_postgresql.mk @@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,postgresql, \ external/postgresql/windows.patch.0 \ external/postgresql/postgresql.exit.patch.0 \ external/postgresql/postgres-msvc-build.patch.1 \ + external/postgresql/0001-Assume-that-stdbool.h-conforms-to-the-C-standard.patch.1 \ $(if $(filter WNT_AARCH64,$(OS)_$(CPUNAME)), external/postgresql/arm64.patch.1) \ ))
