Skip to content

Commit ff7029b

Browse files
committed
Suppress deprecation warning on IDNA2003 ICU methods for clang
1 parent cdf16c0 commit ff7029b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/intl/idn/idn.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
223223
UParseError parse_error;
224224

225225
status = U_ZERO_ERROR;
226-
#if (ZEND_GCC_VERSION >= 4002) && !defined(__clang__)
226+
#if defined(__clang__)
227+
# pragma clang diagnostic push
228+
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
229+
#elif ZEND_GCC_VERSION >= 4002
227230
# pragma GCC diagnostic push
228231
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
229232
#endif
@@ -232,7 +235,9 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
232235
} else {
233236
converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
234237
}
235-
#if (ZEND_GCC_VERSION >= 4002) && !defined(__clang__)
238+
#if defined(__clang__)
239+
# pragma clang diagnostic pop
240+
#elif ZEND_GCC_VERSION >= 4002
236241
# pragma GCC diagnostic pop
237242
#endif
238243
efree(ustring);

0 commit comments

Comments
 (0)