From 246962dd19101a022ef89836a08242b268c3d1ac Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 4 Mar 2021 07:47:21 +0100 Subject: update to 4.0.0 raise dependency on PHP 7.2 --- luasandbox_compat.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 luasandbox_compat.h (limited to 'luasandbox_compat.h') diff --git a/luasandbox_compat.h b/luasandbox_compat.h new file mode 100644 index 0000000..b0a13c2 --- /dev/null +++ b/luasandbox_compat.h @@ -0,0 +1,36 @@ +// Macros to hide the differences between PHP versions +// Implementation details, include only from .c files +#ifndef LUASANDBOX_COMPAT_H +#define LUASANDBOX_COMPAT_H + +#if PHP_VERSION_ID < 80000 + + #define luasandbox_update_property(scope, object, name, name_length, value) \ + zend_update_property(scope, object, name, name_length, value) + + #define luasandbox_update_property_string(scope, object, name, name_length, value) \ + zend_update_property_string(scope, object, name, name_length, value) + + #define luasandbox_update_property_long(scope, object, name, name_length, value) \ + zend_update_property_long(scope, object, name, name_length, value) + + #define luasandbox_read_property(scope, object, name, name_length, silent, rv) \ + zend_read_property(scope, object, name, name_length, silent, rv) + +#else + + #define luasandbox_update_property(scope, object, name, name_length, value) \ + zend_update_property(scope, Z_OBJ_P(object), name, name_length, value) + + #define luasandbox_update_property_string(scope, object, name, name_length, value) \ + zend_update_property_string(scope, Z_OBJ_P(object), name, name_length, value) + + #define luasandbox_update_property_long(scope, object, name, name_length, value) \ + zend_update_property_long(scope, Z_OBJ_P(object), name, name_length, value) + + #define luasandbox_read_property(scope, object, name, name_length, silent, rv) \ + zend_read_property(scope, Z_OBJ_P(object), name, name_length, silent, rv) + +#endif + +#endif // LUASANDBOX_COMPAT_H -- cgit