forked from wikimedia/mediawiki-php-luasandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
luasandbox_compat.h
36 lines (24 loc) · 1.52 KB
/
luasandbox_compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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