Skip to content

Ensure compatibility with PHP 7.x #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions vips.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down