Suppress deprecation warning on IDNA2003 ICU methods for clang
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 23 Aug 2019 09:14:18 +0000 (11:14 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 23 Aug 2019 10:18:58 +0000 (12:18 +0200)
ext/intl/idn/idn.c

index 877a27cbe8a7d2b6746758f08c193222510539a1..60d7b829d84e8f3d41d84300a5b180492cf58ba1 100644 (file)
@@ -223,7 +223,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
                UParseError parse_error;
 
                status = U_ZERO_ERROR;
-#if (ZEND_GCC_VERSION >= 4002) && !defined(__clang__)
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#elif ZEND_GCC_VERSION >= 4002
 # pragma GCC diagnostic push
 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
@@ -232,7 +235,9 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
                } else {
                        converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
                }
-#if (ZEND_GCC_VERSION >= 4002) && !defined(__clang__)
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#elif ZEND_GCC_VERSION >= 4002
 # pragma GCC diagnostic pop
 #endif
                efree(ustring);