Discussion:
com php/gtk-src: use init class macros and ifdef out stuff touching default properties for now on 5.4: main/phpg_gobject.c main/phpg_support.c
Elizabeth Marie Smith
2012-07-17 15:20:47 UTC
Permalink
Commit: 84e3370df4e9e56a1a2e9ec632679c42ad593349
Author: Elizabeth M Smith <***@gmail.com> Tue, 17 Jul 2012 11:20:47 -0400
Parents: e349ad95ec005767327b5936346574571d358d29
Branches: master

Link: http://git.php.net/?p=php/gtk-src.git;a=commitdiff;h=84e3370df4e9e56a1a2e9ec632679c42ad593349

Log:
use init class macros and ifdef out stuff touching default properties for now on 5.4

Changed paths:
M main/phpg_gobject.c
M main/phpg_support.c


Diff:
diff --git a/main/phpg_gobject.c b/main/phpg_gobject.c
index 9727a55..437f50e 100644
--- a/main/phpg_gobject.c
+++ b/main/phpg_gobject.c
@@ -1419,7 +1419,7 @@ static PHP_METHOD(GObject, register_type)
zend_declare_class_constant_long(class, "gtype", sizeof("gtype")-1, new_type TSRMLS_CC);

zend_update_class_constants(class TSRMLS_CC);
-
+#if PHP_VERSION_ID < 50399
/* register properties */
if (zend_hash_find(&class->default_properties, "__gproperties", sizeof("__gproperties"), (void**)&prop_decls) == SUCCESS) {
if (Z_TYPE_PP(prop_decls) != IS_ARRAY) {
@@ -1455,7 +1455,7 @@ static PHP_METHOD(GObject, register_type)
}
zend_hash_del(&class->default_properties, "__gsignals", sizeof("__gsignals"));
}
-
+#endif
if (free_name) {
g_free(type_name);
}
diff --git a/main/phpg_support.c b/main/phpg_support.c
index 4eca9d6..cee6364 100644
--- a/main/phpg_support.c
+++ b/main/phpg_support.c
@@ -271,7 +271,7 @@ PHP_GTK_API void phpg_init_object(void *object, zend_class_entry *ce TSRMLS_DC)

poh->pi_hash = NULL;

-#if PHP_VERSION_ID < 50399
+#if PHP_VERSION_ID < 50399
zend_hash_copy(poh->zobj.properties, &(ce->default_properties),
(copy_ctor_func_t)zval_add_ref, (void *)(&tmp),
sizeof(zval *));
@@ -288,7 +288,7 @@ PHP_GTK_API void phpg_init_object(void *object, zend_class_entry *ce TSRMLS_DC)
prop_ce = prop_ce->parent;
}

- zend_hash_find(&phpg_prop_info, prop_ce->name, prop_ce->name_length+1, (void **) &poh->pi_hash);
+ //zend_hash_find(&phpg_prop_info, prop_ce->name, prop_ce->name_length+1, (void **) &poh->pi_hash);
}
/* }}} */

@@ -311,11 +311,7 @@ PHP_GTK_API zend_class_entry* phpg_register_class(const char *class_name,
phpg_class_key = g_quark_from_static_string(phpg_class_id);
}

- memset(&ce, 0, sizeof(ce));
-
- ce.name = strdup(class_name);
- ce.name_length = strlen(class_name);
- ce.builtin_functions = class_methods;
+ INIT_CLASS_ENTRY_EX(ce, strdup(class_name), strlen(class_name), class_methods);

real_ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC);

@@ -365,10 +361,7 @@ PHP_GTK_API zend_class_entry* phpg_register_interface(const char *iface_name,
phpg_class_key = g_quark_from_static_string(phpg_class_id);
}

- memset(&ce, 0, sizeof(ce));
- ce.name = strdup(iface_name);
- ce.name_length = strlen(iface_name);
- ce.builtin_functions = iface_methods;
+ INIT_CLASS_ENTRY_EX(ce, strdup(iface_name), strlen(iface_name), iface_methods);

real_ce = zend_register_internal_interface(&ce TSRMLS_CC);
--
PHP-GTK CVS Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...