From 607567b9cd750a018f7af2d22ea63bf42be106fa Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 18 Jun 2020 17:10:22 +0200 Subject: [PATCH] Call zpp in enchant_broker_*_dict_path with libenchant-2 Even if the function is a dummy, we still need to call zpp to comply with arginfo. --- ext/enchant/enchant.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 5f7e043730..19918e8a84 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -346,13 +346,11 @@ PHP_FUNCTION(enchant_broker_get_error) } /* }}} */ -#if HAVE_ENCHANT_BROKER_SET_PARAM /* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value) Set the directory path for a given backend, works with ispell and myspell */ PHP_FUNCTION(enchant_broker_set_dict_path) { zval *broker; - enchant_broker *pbroker; zend_long dict_type; char *value; size_t value_len; @@ -361,6 +359,8 @@ PHP_FUNCTION(enchant_broker_set_dict_path) RETURN_THROWS(); } +#if HAVE_ENCHANT_BROKER_SET_PARAM + enchant_broker *pbroker; if (!value_len) { RETURN_FALSE; } @@ -383,6 +383,7 @@ PHP_FUNCTION(enchant_broker_set_dict_path) default: RETURN_FALSE; } +#endif } /* }}} */ @@ -392,14 +393,15 @@ PHP_FUNCTION(enchant_broker_set_dict_path) PHP_FUNCTION(enchant_broker_get_dict_path) { zval *broker; - enchant_broker *pbroker; zend_long dict_type; - char *value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &broker, enchant_broker_ce, &dict_type) == FAILURE) { RETURN_THROWS(); } +#if HAVE_ENCHANT_BROKER_SET_PARAM + enchant_broker *pbroker; + char *value; PHP_ENCHANT_GET_BROKER; switch (dict_type) { @@ -423,26 +425,9 @@ PHP_FUNCTION(enchant_broker_get_dict_path) } RETURN_STRING(value); +#endif } /* }}} */ -#else -/* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value) - Set the directory path for a given backend, works with ispell and myspell */ -PHP_FUNCTION(enchant_broker_set_dict_path) -{ - RETURN_FALSE; -} -/* }}} */ - - -/* {{{ proto string enchant_broker_get_dict_path(resource broker, int dict_type) - Get the directory path for a given backend, works with ispell and myspell */ -PHP_FUNCTION(enchant_broker_get_dict_path) -{ - RETURN_FALSE; -} -/* }}} */ -#endif /* {{{ proto array enchant_broker_list_dicts(resource broker) Lists the dictionaries available for the given broker */ -- 2.50.1