summaryrefslogtreecommitdiff
path: root/ext/intl/resourcebundle/resourcebundle_class.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/resourcebundle/resourcebundle_class.h')
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h
index 8da3ed9d47..7cb015a8df 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.h
+++ b/ext/intl/resourcebundle/resourcebundle_class.h
@@ -25,17 +25,22 @@
#include "intl_error.h"
typedef struct {
- zend_object zend;
intl_error error;
UResourceBundle *me;
UResourceBundle *child;
+ zend_object zend;
} ResourceBundle_object;
+static inline ResourceBundle_object *php_intl_resourcebundle_fetch_object(zend_object *obj) {
+ return (ResourceBundle_object *)((char*)(obj) - XtOffsetOf(ResourceBundle_object, zend));
+}
+#define Z_INTL_RESOURCEBUNDLE_P(zv) php_intl_resourcebundle_fetch_object(Z_OBJ_P(zv))
+
#define RESOURCEBUNDLE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(ResourceBundle, rb)
-#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
+#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_RESOURCEBUNDLE, rb)
#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT \
- INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb); \
+ INTL_METHOD_FETCH_OBJECT(INTL_RESOURCEBUNDLE, rb); \
if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \
"Found unconstructed ResourceBundle", 0 TSRMLS_CC); \