diff --git a/vips.c b/vips.c index ae5a8e5..813345d 100644 --- a/vips.c +++ b/vips.c @@ -24,6 +24,42 @@ ZEND_DECLARE_MODULE_GLOBALS(vips) */ +/* backward compat macros */ + +#ifndef IS_VOID +# define IS_VOID 0 +#endif /* !defined(IS_VOID) */ + +#ifndef IS_MIXED +# define IS_MIXED 0 +#endif /* !defined(IS_MIXED) */ + +#ifndef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX +# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, num_args, type) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, num_args) +#endif /* !defined(ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX) */ + +#ifndef ZEND_ARG_TYPE_MASK +# define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ + ZEND_ARG_TYPE_INFO(pass_by_ref, name, 0, 0) +#endif /* !defined(ZEND_ARG_TYPE_MASK) */ + +#ifndef ZEND_ARG_VARIADIC_TYPE_INFO +# define ZEND_ARG_VARIADIC_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, NULL, type_hint, pass_by_ref, allow_null, 1 }, +#endif /* !defined(ZEND_ARG_VARIADIC_TYPE_INFO) */ + +#ifndef ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE +# define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ + ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) +#endif /* !defined(ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE) */ + +#if PHP_VERSION_ID < 70200 +# undef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX +# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ + static const zend_internal_arg_info name[] = { \ + { (const char*)(zend_uintptr_t)(required_num_args), ( #class_name ), 0, return_reference, allow_null, 0 }, +#endif /* PHP_VERSION_ID < 70200 */ + #include "vips_arginfo.h" /* True global resources - no need for thread safety here */