diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index 07c848ca688b1..b7a5ebb8110bb 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -65,7 +65,6 @@ if test "$PHP_PGSQL" != "no"; then old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -I$PGSQL_INCLUDE" AC_CHECK_LIB(pq, PQlibVersion,, AC_MSG_ERROR([Unable to build the PostgreSQL extension: at least libpq 9.1 is required])) - AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte])) AC_CHECK_LIB(pq, lo_truncate64, AC_DEFINE(HAVE_PG_LO64,1,[PostgreSQL 9.3 or later])) AC_CHECK_LIB(pq, PQsetErrorContextVisibility, AC_DEFINE(HAVE_PG_CONTEXT_VISIBILITY,1,[PostgreSQL 9.6 or later])) AC_CHECK_LIB(pq, PQresultMemorySize, AC_DEFINE(HAVE_PG_RESULT_MEMORY_SIZE,1,[PostgreSQL 12 or later])) diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32 index 603239c43144d..7ad46fd8892e6 100644 --- a/ext/pgsql/config.w32 +++ b/ext/pgsql/config.w32 @@ -7,7 +7,7 @@ if (PHP_PGSQL != "no") { CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) { EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library'); - ADD_FLAG("CFLAGS_PGSQL", "/D PGSQL_EXPORTS /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT" + (X64 ? " /D HAVE_PG_LO64" : "") + " "); + ADD_FLAG("CFLAGS_PGSQL", "/D PGSQL_EXPORTS" + (X64 ? " /D HAVE_PG_LO64" : "") + " "); ADD_EXTENSION_DEP('pgsql', 'pcre'); } else { WARNING("pgsql not enabled; libraries and headers not found"); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 5d23741b0c065..09328c0d921a6 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -278,10 +278,6 @@ static void pgsql_lob_free_obj(zend_object *obj) /* Compatibility definitions */ -#ifndef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT -#define pg_encoding_to_char(x) "SQL_ASCII" -#endif - static zend_string *_php_pgsql_trim_message(const char *message) { size_t i = strlen(message); @@ -601,11 +597,7 @@ PHP_MINFO_FUNCTION(pgsql) php_info_print_table_start(); php_info_print_table_row(2, "PostgreSQL Support", "enabled"); php_info_print_table_row(2, "PostgreSQL (libpq) Version", pgsql_libpq_version); -#ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT php_info_print_table_row(2, "Multibyte character support", "enabled"); -#else - php_info_print_table_row(2, "Multibyte character support", "disabled"); -#endif snprintf(buf, sizeof(buf), ZEND_LONG_FMT, PGG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); snprintf(buf, sizeof(buf), ZEND_LONG_FMT, PGG(num_links)); diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index b9a5fec11d541..5e661e1065f91 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -48,10 +48,6 @@ extern zend_module_entry pgsql_module_entry; # endif #endif -#ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT -const char * pg_encoding_to_char(int encoding); -#endif - PHP_MINIT_FUNCTION(pgsql); PHP_MSHUTDOWN_FUNCTION(pgsql); PHP_RINIT_FUNCTION(pgsql);