diff --git a/src/complex.hh b/src/complex.hh index f2f34e4..684f97a 100644 --- a/src/complex.hh +++ b/src/complex.hh @@ -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**); diff --git a/src/mapval.hh b/src/mapval.hh index c2037fa..256ba0c 100644 --- a/src/mapval.hh +++ b/src/mapval.hh @@ -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*); diff --git a/src/php_arma.hh b/src/php_arma.hh index 35d1abe..d34578c 100644 --- a/src/php_arma.hh +++ b/src/php_arma.hh @@ -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(ecalloc(1, - sizeof(T) + sizeof(zend_object) + zend_object_properties_size(ce))); + auto obj = reinterpret_cast(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(ecalloc(1, + auto zobj = reinterpret_cast(emalloc( sizeof(zend_object) + zend_object_properties_size(ce))); zobj->handlers = handlers; zend_object_std_init(zobj, ce);