Fix [-Wundef] warning in PDO MySQL extension

This commit is contained in:
George Peter Banyard 2020-05-20 15:41:13 +02:00
parent db7dc2fa2f
commit c932cc841a
4 changed files with 24 additions and 24 deletions

View file

@ -32,7 +32,7 @@
#endif
#include "zend_exceptions.h"
#if defined(PDO_USE_MYSQLND)
#ifdef PDO_USE_MYSQLND
# define pdo_mysql_init(persistent) mysqlnd_init(MYSQLND_CLIENT_NO_FLAG, persistent)
#else
# define pdo_mysql_init(persistent) mysql_init(NULL)
@ -224,7 +224,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len
if (S->num_params) {
S->params_given = 0;
#if defined(PDO_USE_MYSQLND)
#ifdef PDO_USE_MYSQLND
S->params = NULL;
#else
S->params = ecalloc(S->num_params, sizeof(MYSQL_BIND));
@ -444,7 +444,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
ZVAL_STRING(return_value, (char *)mysql_get_host_info(H->server));
break;
case PDO_ATTR_SERVER_INFO: {
#if defined(PDO_USE_MYSQLND)
#ifdef PDO_USE_MYSQLND
zend_string *tmp;
if (mysqlnd_stat(H->server, &tmp) == PASS) {
@ -577,7 +577,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
|CLIENT_MULTI_RESULTS
#endif
;
#if defined(PDO_USE_MYSQLND)
#ifdef PDO_USE_MYSQLND
size_t dbname_len = 0;
size_t password_len = 0;
#endif
@ -610,7 +610,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
pdo_mysql_error(dbh);
goto cleanup;
}
#if defined(PDO_USE_MYSQLND)
#ifdef PDO_USE_MYSQLND
if (dbh->is_persistent) {
mysqlnd_restart_psession(H->server);
}