Introduce convert_to_*_ex()

This commit is contained in:
Zeev Suraski 1999-09-16 23:15:34 +00:00
parent ec50085da3
commit 52e769d883

View File

@ -70,4 +70,44 @@ ZEND_API int zend_binary_strcmp(zval *s1, zval *s2);
ZEND_API int zend_binary_strcasecmp(zval *s1, zval *s2);
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_long_ex(ppzv) \
if ((*ppzv)->type!=IS_LONG) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_long(*ppzv); \
}
#define convert_to_double_ex(ppzv) \
if ((*ppzv)->type!=IS_DOUBLE) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_double(*ppzv); \
}
#define convert_to_string_ex(ppzv) \
if ((*ppzv)->type!=IS_STRING) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_string(*ppzv); \
}
#define convert_to_array_ex(ppzv) \
if ((*ppzv)->type!=IS_ARRAY) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_array(*ppzv); \
}
#define convert_to_object_ex(ppzv) \
if ((*ppzv)->type!=IS_OBJECT) { \
if (!(*ppzv)->EA.is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_object(*ppzv); \
}
#endif