From 908b9adf504e689a81e68a0789e1f0cf58d17de5 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 27 May 2024 17:19:22 +0200 Subject: [PATCH] Sync HAVE_ENCHANT_BROKER_SET_PARAM definitions This defines the HAVE_ENCHANT_BROKER_SET_PARAM to 1 or doesn't define it so it can be used in a similar way between platforms. It is only defined for Enchant versions 1.5.0 to 2.x. Previously on Windows it was defined to 0 if not found. --- ext/enchant/config.w32 | 1 - ext/enchant/enchant.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/enchant/config.w32 b/ext/enchant/config.w32 index 73aca99ef79a8..57a32ee219942 100644 --- a/ext/enchant/config.w32 +++ b/ext/enchant/config.w32 @@ -7,7 +7,6 @@ if (PHP_ENCHANT == "yes") { CHECK_HEADER_ADD_INCLUDE("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0")) { if (CHECK_LIB("libenchant2.lib", "enchant", PHP_ENCHANT)) { have_enchant = true; - AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 0); } else if (CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT)) { have_enchant = true; AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1); diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index b4da0ad22526e..7cb40da042e06 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -342,7 +342,7 @@ PHP_FUNCTION(enchant_broker_set_dict_path) RETURN_THROWS(); } -#if HAVE_ENCHANT_BROKER_SET_PARAM +#ifdef HAVE_ENCHANT_BROKER_SET_PARAM enchant_broker *pbroker; if (!value_len) { RETURN_FALSE; @@ -381,7 +381,7 @@ PHP_FUNCTION(enchant_broker_get_dict_path) RETURN_THROWS(); } -#if HAVE_ENCHANT_BROKER_SET_PARAM +#ifdef HAVE_ENCHANT_BROKER_SET_PARAM enchant_broker *pbroker; char *value; PHP_ENCHANT_GET_BROKER;