From 50837914ce2d8dcc3fbf91dba2fc865034d54146 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 10 Oct 2024 16:31:16 +0200 Subject: [PATCH] Drop legacy fallback for `isc_get_client_version()` The respective code had been introduced 20 years ago, and we can assume that the function is available at least of Firebird 3.0, what we require anyway. --- ext/pdo_firebird/firebird_driver.c | 24 +++--------------------- ext/pdo_firebird/php_pdo_firebird_int.h | 6 ------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 23f17914dcd76..c0e6b5bfb1cf6 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -1219,27 +1219,9 @@ static int pdo_firebird_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) ZVAL_BOOL(val, !isc_version(&H->db, php_firebird_info_cb, NULL)); return 1; - case PDO_ATTR_CLIENT_VERSION: { -#if defined(__GNUC__) || defined(PHP_WIN32) - info_func_t info_func = NULL; -#ifdef __GNUC__ - info_func = (info_func_t)dlsym(RTLD_DEFAULT, "isc_get_client_version"); -#else - HMODULE l = GetModuleHandle("fbclient"); - - if (!l) { - break; - } - info_func = (info_func_t)GetProcAddress(l, "isc_get_client_version"); -#endif - if (info_func) { - info_func(tmp); - ZVAL_STRING(val, tmp); - } -#else - ZVAL_NULL(val); -#endif - } + case PDO_ATTR_CLIENT_VERSION: + isc_get_client_version(tmp); + ZVAL_STRING(val, tmp); return 1; case PDO_ATTR_SERVER_VERSION: diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h index 2b8d00a4e37e6..db7b730ead40d 100644 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ b/ext/pdo_firebird/php_pdo_firebird_int.h @@ -45,12 +45,6 @@ /* Firebird API has a couple of missing const decls in its API */ #define const_cast(s) ((char*)(s)) -#ifdef PHP_WIN32 -typedef void (__stdcall *info_func_t)(char*); -#else -typedef void (*info_func_t)(char*); -#endif - #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) #endif