Commit dd284b682e1909f9583551f9579b7f98380cfbae
1 parent
5e17b881
Exists in
master
and in
5 other branches
Tentando corrigir build da extensão PHP no Ubuntu.
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
src/php/main.cc
@@ -93,7 +93,13 @@ zend_object_value tn3270_create_handler(zend_class_entry *type TSRMLS_DC) | @@ -93,7 +93,13 @@ zend_object_value tn3270_create_handler(zend_class_entry *type TSRMLS_DC) | ||
93 | 93 | ||
94 | zend_object_std_init( &(obj->std), type TSRMLS_CC ); | 94 | zend_object_std_init( &(obj->std), type TSRMLS_CC ); |
95 | 95 | ||
96 | - object_properties_init((zend_object*) &(obj->std), type); | 96 | + // http://stackoverflow.com/questions/14105529/writing-a-c-extension-for-php-5-4-example-code-is-obsolete |
97 | + // object_properties_init((zend_object*) &(obj->std), type); | ||
98 | +#if PHP_VERSION_ID < 50399 | ||
99 | + zend_hash_copy(obj->std.properties, &(type->default_properties),(copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*)); | ||
100 | +#else | ||
101 | + object_properties_init(&obj->std, type); | ||
102 | +#endif | ||
97 | 103 | ||
98 | retval.handle = zend_objects_store_put(obj, NULL, tn3270_free_storage, NULL TSRMLS_CC); | 104 | retval.handle = zend_objects_store_put(obj, NULL, tn3270_free_storage, NULL TSRMLS_CC); |
99 | retval.handlers = &tn3270_object_handlers; | 105 | retval.handlers = &tn3270_object_handlers; |