summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 0a073420e3..d98aa55b3a 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -75,29 +75,28 @@ PHPAPI zend_class_entry *reflection_extension_ptr;
PHPAPI zend_class_entry *reflection_zend_extension_ptr;
/* Exception throwing macro */
-#define _DO_THROW(msg) \
- zend_throw_exception(reflection_exception_ptr, msg, 0); \
- return; \
-
-#define RETURN_ON_EXCEPTION \
- if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \
- return; \
- }
-
-#define GET_REFLECTION_OBJECT() \
- intern = Z_REFLECTION_P(getThis()); \
- if (intern->ptr == NULL) { \
- RETURN_ON_EXCEPTION \
- zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \
- return; \
- } \
+#define _DO_THROW(msg) \
+ zend_throw_exception(reflection_exception_ptr, msg, 0); \
+ return;
+
+#define GET_REFLECTION_OBJECT() do { \
+ intern = Z_REFLECTION_P(getThis()); \
+ if (intern->ptr == NULL) { \
+ if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \
+ return; \
+ } \
+ zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \
+ return; \
+ } \
+} while (0)
-#define GET_REFLECTION_OBJECT_PTR(target) \
- GET_REFLECTION_OBJECT() \
- target = intern->ptr; \
+#define GET_REFLECTION_OBJECT_PTR(target) do { \
+ GET_REFLECTION_OBJECT(); \
+ target = intern->ptr; \
+} while (0)
/* Class constants */
-#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \
+#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \
zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value);
/* {{{ Object structure */