Skip to content

Commit ff39e51

Browse files
author
Andi Gutmans
committed
- Make com work with new object model
1 parent 1388a3a commit ff39e51

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

ext/com/com.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,18 @@ typedef struct comval_ {
2121

2222
#define ZVAL_COM(z,o) { \
2323
zval *handle; \
24+
HashTable *properties; \
2425
\
25-
/* OBJECTS_FIXME */ \
26-
Z_TYPE_P(z) = IS_OBJECT; \
27-
Z_OBJCE_P(z) = &com_class_entry; \
28-
\
29-
ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \
30-
zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \
26+
ALLOC_HASHTABLE(properties); \
27+
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
3128
\
3229
ALLOC_ZVAL(handle); \
3330
INIT_PZVAL(handle); \
3431
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
3532
\
3633
zval_copy_ctor(handle); \
37-
zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \
34+
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
35+
object_and_properties_init(z, &com_class_entry, properties); \
3836
}
3937

4038
#define RETVAL_COM(o) ZVAL_COM(&return_value, o)

ext/com/conversion.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
758758
}
759759
else
760760
{
761+
TSRMLS_FETCH();
762+
761763
ALLOC_COM(obj);
762764
php_COM_set(obj, V_DISPATCH(var_arg), TRUE);
763765

ext/rpc/com/com_wrapper.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,18 @@ typedef struct comval_ {
2121

2222
#define ZVAL_COM(z,o) { \
2323
zval *handle; \
24+
HashTable *properties; \
2425
\
25-
/* OBJECTS_FIXME */ \
26-
Z_TYPE_P(z) = IS_OBJECT; \
27-
Z_OBJCE_P(z) = &com_class_entry; \
28-
\
29-
ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \
30-
zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \
26+
ALLOC_HASHTABLE(properties); \
27+
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
3128
\
3229
ALLOC_ZVAL(handle); \
3330
INIT_PZVAL(handle); \
3431
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
3532
\
3633
zval_copy_ctor(handle); \
37-
zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \
34+
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
35+
object_and_properties_init(z, &com_class_entry, properties); \
3836
}
3937

4038
#define RETVAL_COM(o) ZVAL_COM(&return_value, o)

ext/rpc/com/conversion.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
758758
}
759759
else
760760
{
761+
TSRMLS_FETCH();
762+
761763
ALLOC_COM(obj);
762764
php_COM_set(obj, V_DISPATCH(var_arg), TRUE);
763765

0 commit comments

Comments
 (0)