This commit is contained in:
CismonX 2019-03-29 20:18:44 +08:00
parent d7c9ca7d13
commit 26859a537a
3 changed files with 7 additions and 8 deletions

View File

@ -23,7 +23,7 @@ namespace php_arma
PHP_ARMA_CE_HANDLRES_DECLARE();
private:
static ZEND_NAMED_FUNCTION(__construct);
static PHP_FUNCTION(__construct);
static void write_property(zval*, zval*, zval*, void**);

View File

@ -60,8 +60,8 @@ namespace php_arma
PHP_ARMA_CE_HANDLRES_DECLARE();
private:
static ZEND_NAMED_FUNCTION(val);
static ZEND_NAMED_FUNCTION(setTo);
static PHP_FUNCTION(val);
static PHP_FUNCTION(setTo);
static T get_val(zend_object*);

View File

@ -34,13 +34,13 @@ extern zend_module_entry arma_module_entry;
}
#define PHP_ARMA_ME(func, flags) \
ZEND_FENTRY(func, func, nullptr, flags)
ZEND_FENTRY(func, zif_##func, nullptr, flags)
#define PHP_ARMA_METHODS(cls, ...) \
cls<__VA_ARGS__>::me
#define PHP_ARMA_FUNCTION(cls, func, ...) \
void ZEND_FASTCALL cls<__VA_ARGS__>::func(INTERNAL_FUNCTION_PARAMETERS)
void ZEND_FASTCALL cls<__VA_ARGS__>::zif_##func(INTERNAL_FUNCTION_PARAMETERS)
/// Helper macros for class entry and object handlers
@ -131,8 +131,7 @@ namespace php_arma
zend_always_inline
zend_object *object_create(zend_class_entry *ce, F init)
{
auto obj = reinterpret_cast<T*>(ecalloc(1,
sizeof(T) + sizeof(zend_object) + zend_object_properties_size(ce)));
auto obj = reinterpret_cast<T*>(emalloc(sizeof(T) + sizeof(zend_object) - sizeof(zval)));
auto zobj = to_zend_object(obj);
zobj->handlers = init(obj);
zend_object_std_init(zobj, ce);
@ -142,7 +141,7 @@ namespace php_arma
zend_always_inline
zend_object *object_create(zend_class_entry *ce, const zend_object_handlers *handlers)
{
auto zobj = reinterpret_cast<zend_object *>(ecalloc(1,
auto zobj = reinterpret_cast<zend_object *>(emalloc(
sizeof(zend_object) + zend_object_properties_size(ce)));
zobj->handlers = handlers;
zend_object_std_init(zobj, ce);