Skip to content

Commit fa21fce

Browse files
Christian Schneiderdevnexen
Christian Schneider
authored andcommitted
ext/pgsql: Add check for constant PGRES_TUPLES_CHUNK to fix compilation failures
close GH-17540
1 parent 0b12db6 commit fa21fce

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ PHP NEWS
6565
the cpu mask argument with entries type different than int/string.
6666
(David Carlier)
6767

68+
- PgSql:
69+
. Fixed build failure when the constant PGRES_TUPLES_CHUNK is not present
70+
in the system. (chschneider)
71+
6872
- Phar:
6973
. Fixed bug GH-17518 (offset overflow phar extractTo()). (nielsdos)
7074

ext/pgsql/config.m4

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ if test "$PHP_PGSQL" != "no"; then
2828
[Define to 1 if libpq has the 'PQsocketPoll' function (PostgreSQL 17 or
2929
later).])],,
3030
[$PGSQL_LIBS])
31-
PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode],
32-
[AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1],
33-
[Define to 1 if libpq has the 'PQsetChunkedRowsMode' function (PostgreSQL
34-
17 or later).])],,
35-
[$PGSQL_LIBS])
3631

3732
old_CFLAGS=$CFLAGS
3833
CFLAGS="$CFLAGS $PGSQL_CFLAGS"
3934

35+
AC_CHECK_DECLS([PGRES_TUPLES_CHUNK],
36+
PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode],
37+
[AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1],
38+
[Define to 1 if libpq has the 'PQsetChunkedRowsMode' function (PostgreSQL
39+
17 or later).])],,
40+
[$PGSQL_LIBS]),,
41+
[#include <libpq-fe.h>]
42+
)
43+
4044
dnl Available since PostgreSQL 12.
4145
AC_CACHE_CHECK([if PGVerbosity enum has PQERRORS_SQLSTATE],
4246
[php_cv_enum_pgverbosity_pqerrors_sqlstate],

0 commit comments

Comments
 (0)