diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-24 14:51:41 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-24 14:51:41 +0100 |
commit | aecf6c450fc4ad9b1b3ee0ce4450b9dac5ce2967 (patch) | |
tree | 12ffe9aa7f6b4a6ac4c2273aa8e2063ce7b685b9 /src | |
parent | 2fd4198b78358cf2ba527296fafb5b1728e28ea8 (diff) |
fix compile issues for TRSM
Diffstat (limited to 'src')
-rw-r--r-- | src/base.cpp | 21 | ||||
-rw-r--r-- | src/classbase.cpp | 4 | ||||
-rw-r--r-- | src/exception.cpp | 2 |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/base.cpp b/src/base.cpp index cefffd8..75363af 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -47,9 +47,28 @@ MixedObject *Base::store(zend_class_entry *entry TSRMLS_DC) #endif +#if ZTS + + // when in thread safety mode, the destruct method and free method have + // an extra parameter holding thread information + using DestructType = void(zend_object*,unsigned int,void***); + using FreeType = void(zend_object*,void***); + +#else + + // not in thread mode: no special parameter for the tsrm_ls variable + using DestructType = void(zend_object*,unsigned int); + using FreeType = void(zend_object*); + +#endif + + // store the two destruct methods in temporary vars + DestructType *destructMethod = &ClassBase::destructObject; + FreeType *freeMethod = &ClassBase::freeObject; + // the destructor and clone handlers are set to NULL. I dont know why, but they do not // seem to be necessary... - _handle = zend_objects_store_put(result, (zend_objects_store_dtor_t)ClassBase::destructObject, (zend_objects_free_object_storage_t)ClassBase::freeObject, NULL TSRMLS_CC); + _handle = zend_objects_store_put(result, (zend_objects_store_dtor_t)destructMethod, (zend_objects_free_object_storage_t)freeMethod, NULL TSRMLS_CC); // done return result; diff --git a/src/classbase.cpp b/src/classbase.cpp index 21d33ba..eadc4c6 100644 --- a/src/classbase.cpp +++ b/src/classbase.cpp @@ -1015,9 +1015,9 @@ void ClassBase::writeProperty(zval *object, zval *name, zval *value, const struc * @return bool */ #if PHP_VERSION_ID < 50399 -int ClassBase::hasProperty(zval *object, zval *name, int has_set_exists, void ***tsrm_ls) +int ClassBase::hasProperty(zval *object, zval *name, int has_set_exists TSRMLS_DC) #else -int ClassBase::hasProperty(zval *object, zval *name, int has_set_exists, const struct _zend_literal *key, void ***tsrm_ls) +int ClassBase::hasProperty(zval *object, zval *name, int has_set_exists, const struct _zend_literal *key TSRMLS_DC) #endif { // the default implementation throws an exception, if we catch that diff --git a/src/exception.cpp b/src/exception.cpp index d409e1a..810a73c 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -16,7 +16,7 @@ namespace Php { /** * Process the exception * - * This method is called only from withing the PHP-CPP library, + * This method is called only from within the PHP-CPP library, * and will turn the exception into a PHP exception * * @param tsrm_ls |