PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) __attribute__((ifunc("resolve_base64_encode")));
PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) __attribute__((ifunc("resolve_base64_decode")));
+typedef zend_string *(*base64_encode_func_t)(const unsigned char *, size_t);
+typedef zend_string *(*base64_decode_func_t)(const unsigned char *, size_t, zend_bool);
+
ZEND_NO_SANITIZE_ADDRESS
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
-static void *resolve_base64_encode() {
+static base64_encode_func_t resolve_base64_encode() {
# if ZEND_INTRIN_AVX2_FUNC_PROTO
if (zend_cpu_supports_avx2()) {
return php_base64_encode_avx2;
ZEND_NO_SANITIZE_ADDRESS
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
-static void *resolve_base64_decode() {
+static base64_decode_func_t resolve_base64_decode() {
# if ZEND_INTRIN_AVX2_FUNC_PROTO
if (zend_cpu_supports_avx2()) {
return php_base64_decode_ex_avx2;